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

Comparing jsr166/src/test/tck/ConcurrentLinkedDequeTest.java (file contents):
Revision 1.16 by jsr166, Wed Dec 31 20:17:39 2014 UTC vs.
Revision 1.17 by jsr166, Sat Jan 17 22:55:06 2015 UTC

# Line 696 | Line 696 | public class ConcurrentLinkedDequeTest e
696       */
697      public void testIterator() {
698          ConcurrentLinkedDeque q = populatedDeque(SIZE);
699        int i = 0;
699          Iterator it = q.iterator();
700 <        while (it.hasNext()) {
700 >        int i;
701 >        for (i = 0; it.hasNext(); i++)
702              assertTrue(q.contains(it.next()));
703            ++i;
704        }
703          assertEquals(i, SIZE);
704 +        assertIteratorExhausted(it);
705 +    }
706 +
707 +    /**
708 +     * iterator of empty collection has no elements
709 +     */
710 +    public void testEmptyIterator() {
711 +        Deque c = new ConcurrentLinkedDeque();
712 +        assertIteratorExhausted(c.iterator());
713 +        assertIteratorExhausted(c.descendingIterator());
714      }
715  
716      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines