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.34 by jsr166, Wed Dec 31 21:45:16 2014 UTC vs.
Revision 1.36 by jsr166, Sun Feb 22 04:34:44 2015 UTC

# Line 77 | Line 77 | public class ConcurrentSkipListSetTest e
77       */
78      public void testConstructor3() {
79          try {
80 <            ConcurrentSkipListSet q = new ConcurrentSkipListSet((Collection)null);
80 >            new ConcurrentSkipListSet((Collection)null);
81              shouldThrow();
82          } catch (NullPointerException success) {}
83      }
# Line 88 | Line 88 | public class ConcurrentSkipListSetTest e
88      public void testConstructor4() {
89          try {
90              Integer[] ints = new Integer[SIZE];
91 <            ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints));
91 >            new ConcurrentSkipListSet(Arrays.asList(ints));
92              shouldThrow();
93          } catch (NullPointerException success) {}
94      }
# Line 101 | Line 101 | public class ConcurrentSkipListSetTest e
101              Integer[] ints = new Integer[SIZE];
102              for (int i = 0; i < SIZE-1; ++i)
103                  ints[i] = new Integer(i);
104 <            ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints));
104 >            new ConcurrentSkipListSet(Arrays.asList(ints));
105              shouldThrow();
106          } catch (NullPointerException success) {}
107      }
# Line 473 | Line 473 | public class ConcurrentSkipListSetTest e
473       */
474      public void testIterator() {
475          ConcurrentSkipListSet q = populatedSet(SIZE);
476        int i = 0;
476          Iterator it = q.iterator();
477 <        while (it.hasNext()) {
477 >        int i;
478 >        for (i = 0; it.hasNext(); i++)
479              assertTrue(q.contains(it.next()));
480            ++i;
481        }
480          assertEquals(i, SIZE);
481 +        assertIteratorExhausted(it);
482      }
483  
484      /**
485       * iterator of empty set has no elements
486       */
487      public void testEmptyIterator() {
488 <        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
489 <        int i = 0;
490 <        Iterator it = q.iterator();
492 <        while (it.hasNext()) {
493 <            assertTrue(q.contains(it.next()));
494 <            ++i;
495 <        }
496 <        assertEquals(0, i);
488 >        NavigableSet s = new ConcurrentSkipListSet();
489 >        assertIteratorExhausted(s.iterator());
490 >        assertIteratorExhausted(s.descendingSet().iterator());
491      }
492  
493      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines