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

Comparing jsr166/src/test/tck/LinkedListTest.java (file contents):
Revision 1.47 by jsr166, Tue Apr 3 05:49:43 2018 UTC vs.
Revision 1.48 by jsr166, Mon May 28 21:19:50 2018 UTC

# Line 358 | Line 358 | public class LinkedListTest extends JSR1
358       */
359      public void testToArray() {
360          LinkedList q = populatedQueue(SIZE);
361 <        Object[] o = q.toArray();
362 <        for (int i = 0; i < o.length; i++)
363 <            assertSame(o[i], q.poll());
361 >        Object[] a = q.toArray();
362 >        assertSame(Object[].class, a.getClass());
363 >        for (Object o : a)
364 >            assertSame(o, q.poll());
365 >        assertTrue(q.isEmpty());
366      }
367  
368      /**
# Line 371 | Line 373 | public class LinkedListTest extends JSR1
373          Integer[] ints = new Integer[SIZE];
374          Integer[] array = q.toArray(ints);
375          assertSame(ints, array);
376 <        for (int i = 0; i < ints.length; i++)
377 <            assertSame(ints[i], q.poll());
376 >        for (Integer o : ints)
377 >            assertSame(o, q.poll());
378 >        assertTrue(q.isEmpty());
379      }
380  
381      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines