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

Comparing jsr166/src/test/tck/ConcurrentLinkedQueueTest.java (file contents):
Revision 1.47 by jsr166, Fri Aug 4 03:30:21 2017 UTC vs.
Revision 1.48 by jsr166, Mon May 28 21:19:50 2018 UTC

# Line 389 | Line 389 | public class ConcurrentLinkedQueueTest e
389       */
390      public void testToArray() {
391          ConcurrentLinkedQueue q = populatedQueue(SIZE);
392 <        Object[] o = q.toArray();
393 <        for (int i = 0; i < o.length; i++)
394 <            assertSame(o[i], q.poll());
392 >        Object[] a = q.toArray();
393 >        assertSame(Object[].class, a.getClass());
394 >        for (Object o : a)
395 >            assertSame(o, q.poll());
396 >        assertTrue(q.isEmpty());
397      }
398  
399      /**
# Line 402 | Line 404 | public class ConcurrentLinkedQueueTest e
404          Integer[] ints = new Integer[SIZE];
405          Integer[] array = q.toArray(ints);
406          assertSame(ints, array);
407 <        for (int i = 0; i < ints.length; i++)
408 <            assertSame(ints[i], q.poll());
407 >        for (Integer o : ints)
408 >            assertSame(o, q.poll());
409 >        assertTrue(q.isEmpty());
410      }
411  
412      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines