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.25 by jsr166, Sat Nov 26 05:42:14 2011 UTC vs.
Revision 1.30 by jsr166, Thu May 30 03:28:55 2013 UTC

# Line 32 | Line 32 | public class ConcurrentSkipListSetTest e
32      }
33  
34      /**
35 <     * Create a set of given size containing consecutive
35 >     * Returns a new set of given size containing consecutive
36       * Integers 0 ... n.
37       */
38      private ConcurrentSkipListSet<Integer> populatedSet(int n) {
# Line 49 | Line 49 | public class ConcurrentSkipListSetTest e
49      }
50  
51      /**
52 <     * Create set of first 5 ints
52 >     * Returns a new set of first 5 ints.
53       */
54      private ConcurrentSkipListSet set5() {
55          ConcurrentSkipListSet q = new ConcurrentSkipListSet();
# Line 461 | Line 461 | public class ConcurrentSkipListSetTest e
461      public void testToArray2() {
462          ConcurrentSkipListSet<Integer> q = populatedSet(SIZE);
463          Integer[] ints = new Integer[SIZE];
464 <        Integer[] array = q.toArray(ints);
465 <        assertSame(ints, array);
464 >        assertSame(ints, q.toArray(ints));
465          for (int i = 0; i < ints.length; i++)
466              assertSame(ints[i], q.pollFirst());
467      }
# Line 532 | Line 531 | public class ConcurrentSkipListSetTest e
531          NavigableSet x = populatedSet(SIZE);
532          NavigableSet y = serialClone(x);
533  
534 <        assertTrue(x != y);
534 >        assertNotSame(x, y);
535          assertEquals(x.size(), y.size());
536          assertEquals(x, y);
537          assertEquals(y, x);
# Line 686 | Line 685 | public class ConcurrentSkipListSetTest e
685                     0, setSize - 1, true, bs);
686      }
687  
688 +    /**
689 +     * addAll is idempotent
690 +     */
691 +    public void testAddAll_idempotent() throws Exception {
692 +        Set x = populatedSet(SIZE);
693 +        Set y = new ConcurrentSkipListSet(x);
694 +        y.addAll(x);
695 +        assertEquals(x, y);
696 +        assertEquals(y, x);
697 +    }
698 +
699      static NavigableSet<Integer> newSet(Class cl) throws Exception {
700          NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance();
701          assertEquals(0, result.size());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines