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.34 by jsr166, Wed Dec 31 20:17:39 2014 UTC vs.
Revision 1.37 by jsr166, Sat Apr 25 04:55:31 2015 UTC

# Line 17 | Line 17 | import junit.framework.TestSuite;
17  
18   public class LinkedListTest extends JSR166TestCase {
19      public static void main(String[] args) {
20 <        junit.textui.TestRunner.run(suite());
20 >        main(suite(), args);
21      }
22  
23      public static Test suite() {
# Line 50 | Line 50 | public class LinkedListTest extends JSR1
50       */
51      public void testConstructor3() {
52          try {
53 <            LinkedList q = new LinkedList((Collection)null);
53 >            new LinkedList((Collection)null);
54              shouldThrow();
55          } catch (NullPointerException success) {}
56      }
# Line 379 | Line 379 | public class LinkedListTest extends JSR1
379       */
380      public void testIterator() {
381          LinkedList q = populatedQueue(SIZE);
382        int i = 0;
382          Iterator it = q.iterator();
383 <        while (it.hasNext()) {
383 >        int i;
384 >        for (i = 0; it.hasNext(); i++)
385              assertTrue(q.contains(it.next()));
386            ++i;
387        }
386          assertEquals(i, SIZE);
387 +        assertIteratorExhausted(it);
388 +    }
389 +
390 +    /**
391 +     * iterator of empty collection has no elements
392 +     */
393 +    public void testEmptyIterator() {
394 +        assertIteratorExhausted(new LinkedList().iterator());
395      }
396  
397      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines