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.14 by jsr166, Wed Aug 25 01:44:48 2010 UTC vs.
Revision 1.17 by jsr166, Thu Nov 4 01:04:54 2010 UTC

# Line 434 | Line 434 | public class ConcurrentSkipListSetTest e
434      }
435  
436      /**
437 <     * toArray contains all elements
437 >     * toArray contains all elements in sorted order
438       */
439      public void testToArray() {
440          ConcurrentSkipListSet q = populatedSet(SIZE);
441          Object[] o = q.toArray();
442        Arrays.sort(o);
442          for (int i = 0; i < o.length; i++)
443 <            assertEquals(o[i], q.pollFirst());
443 >            assertSame(o[i], q.pollFirst());
444      }
445  
446      /**
447 <     * toArray(a) contains all elements
447 >     * toArray(a) contains all elements in sorted order
448       */
449      public void testToArray2() {
450          ConcurrentSkipListSet q = populatedSet(SIZE);
451          Integer[] ints = new Integer[SIZE];
452 <        ints = (Integer[])q.toArray(ints);
454 <        Arrays.sort(ints);
452 >        assertSame(ints, q.toArray(ints));
453          for (int i = 0; i < ints.length; i++)
454 <            assertEquals(ints[i], q.pollFirst());
454 >            assertSame(ints[i], q.pollFirst());
455      }
456  
457      /**
# Line 659 | Line 657 | public class ConcurrentSkipListSetTest e
657       * Subsets of subsets subdivide correctly
658       */
659      public void testRecursiveSubSets() throws Exception {
660 <        int setSize = 1000;
660 >        int setSize = expensiveTests ? 1000 : 100;
661          Class cl = ConcurrentSkipListSet.class;
662  
663          NavigableSet<Integer> set = newSet(cl);
# Line 875 | Line 873 | public class ConcurrentSkipListSetTest e
873                  // BitSet should support this! Test would run much faster
874                  while (element >= min) {
875                      if (bs.get(element))
876 <                        return(element);
876 >                        return element;
877                      element--;
878                  }
879                  return -1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines