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

Comparing jsr166/src/test/tck/ConcurrentSkipListSetTest.java (file contents):
Revision 1.49 by jsr166, Sun Jan 7 22:59:18 2018 UTC vs.
Revision 1.50 by jsr166, Mon May 28 21:36:13 2018 UTC

# Line 456 | Line 456 | public class ConcurrentSkipListSetTest e
456       */
457      public void testToArray() {
458          ConcurrentSkipListSet q = populatedSet(SIZE);
459 <        Object[] o = q.toArray();
460 <        for (int i = 0; i < o.length; i++)
461 <            assertSame(o[i], q.pollFirst());
459 >        Object[] a = q.toArray();
460 >        assertSame(Object[].class, a.getClass());
461 >        for (Object o : a)
462 >            assertSame(o, q.pollFirst());
463 >        assertTrue(q.isEmpty());
464      }
465  
466      /**
# Line 468 | Line 470 | public class ConcurrentSkipListSetTest e
470          ConcurrentSkipListSet<Integer> q = populatedSet(SIZE);
471          Integer[] ints = new Integer[SIZE];
472          assertSame(ints, q.toArray(ints));
473 <        for (int i = 0; i < ints.length; i++)
474 <            assertSame(ints[i], q.pollFirst());
473 >        for (Integer o : ints)
474 >            assertSame(o, q.pollFirst());
475 >        assertTrue(q.isEmpty());
476      }
477  
478      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines