ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/TreeSetTest.java
(Generate patch)

Comparing jsr166/src/test/tck/TreeSetTest.java (file contents):
Revision 1.16 by jsr166, Mon Oct 11 05:40:41 2010 UTC vs.
Revision 1.17 by jsr166, Thu Nov 4 01:04:54 2010 UTC

# Line 439 | Line 439 | public class TreeSetTest extends JSR166T
439      }
440  
441      /**
442 <     * toArray contains all elements
442 >     * toArray contains all elements in sorted order
443       */
444      public void testToArray() {
445          TreeSet q = populatedSet(SIZE);
446          Object[] o = q.toArray();
447        Arrays.sort(o);
447          for (int i = 0; i < o.length; i++)
448 <            assertEquals(o[i], q.pollFirst());
448 >            assertSame(o[i], q.pollFirst());
449      }
450  
451      /**
452 <     * toArray(a) contains all elements
452 >     * toArray(a) contains all elements in sorted order
453       */
454      public void testToArray2() {
455          TreeSet q = populatedSet(SIZE);
456          Integer[] ints = new Integer[SIZE];
457 <        ints = (Integer[])q.toArray(ints);
459 <        Arrays.sort(ints);
457 >        assertSame(ints, q.toArray(ints));
458          for (int i = 0; i < ints.length; i++)
459 <            assertEquals(ints[i], q.pollFirst());
459 >            assertSame(ints[i], q.pollFirst());
460      }
461  
462      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines