[cvs] / jsr166 / src / test / tck / ConcurrentSkipListSetTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/ConcurrentSkipListSetTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10, Sat Nov 21 17:38:05 2009 UTC revision 1.11, Sun Nov 22 18:57:17 2009 UTC
# Line 19  Line 19 
19    
20      static class MyReverseComparator implements Comparator {      static class MyReverseComparator implements Comparator {
21          public int compare(Object x, Object y) {          public int compare(Object x, Object y) {
22              int i = ((Integer)x).intValue();              return ((Comparable)y).compareTo(x);
             int j = ((Integer)y).intValue();  
             if (i < j) return 1;  
             if (i > j) return -1;  
             return 0;  
23          }          }
24      }      }
25    
# Line 245  Line 241 
241          assertFalse(q.addAll(Arrays.asList(empty)));          assertFalse(q.addAll(Arrays.asList(empty)));
242          assertTrue(q.addAll(Arrays.asList(ints)));          assertTrue(q.addAll(Arrays.asList(ints)));
243          for (int i = 0; i < SIZE; ++i)          for (int i = 0; i < SIZE; ++i)
244              assertEquals(new Integer(i), q.pollFirst());              assertEquals(i, q.pollFirst());
245      }      }
246    
247      /**      /**
# Line 254  Line 250 
250      public void testPollFirst() {      public void testPollFirst() {
251          ConcurrentSkipListSet q = populatedSet(SIZE);          ConcurrentSkipListSet q = populatedSet(SIZE);
252          for (int i = 0; i < SIZE; ++i) {          for (int i = 0; i < SIZE; ++i) {
253              assertEquals(i, ((Integer)q.pollFirst()).intValue());              assertEquals(i, q.pollFirst());
254          }          }
255          assertNull(q.pollFirst());          assertNull(q.pollFirst());
256      }      }
# Line 265  Line 261 
261      public void testPollLast() {      public void testPollLast() {
262          ConcurrentSkipListSet q = populatedSet(SIZE);          ConcurrentSkipListSet q = populatedSet(SIZE);
263          for (int i = SIZE-1; i >= 0; --i) {          for (int i = SIZE-1; i >= 0; --i) {
264              assertEquals(i, ((Integer)q.pollLast()).intValue());              assertEquals(i, q.pollLast());
265          }          }
266          assertNull(q.pollFirst());          assertNull(q.pollFirst());
267      }      }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8