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

Comparing jsr166/src/test/loops/NavigableSetCheck.java (file contents):
Revision 1.11 by jsr166, Wed Dec 31 17:00:58 2014 UTC vs.
Revision 1.12 by jsr166, Thu Jan 15 18:34:19 2015 UTC

# Line 37 | Line 37 | public class NavigableSetCheck {
37              }
38          }
39  
40
40          if (args.length > 1)
41              numTests = Integer.parseInt(args[1]);
42  
# Line 46 | Line 45 | public class NavigableSetCheck {
45  
46          System.out.println("Testing " + setClass.getName() + " trials: " + numTests + " size: " + size);
47  
49
48          absentSize = 8;
49          while (absentSize < size) absentSize <<= 1;
50          absentMask = absentSize - 1;
# Line 59 | Line 57 | public class NavigableSetCheck {
57          for (int i = 0; i < size; ++i)
58              key[i] = new Integer(i * 2 + 1);
59  
62
60          for (int rep = 0; rep < numTests; ++rep) {
61              runTest(newSet(setClass), key);
62          }
# Line 77 | Line 74 | public class NavigableSetCheck {
74          }
75      }
76  
80
77      static void runTest(NavigableSet s, Integer[] key) {
78          shuffle(key);
79          int size = key.length;
# Line 171 | Line 167 | public class NavigableSetCheck {
167          reallyAssert(sum == expect);
168      }
169  
174
170      static void higherTest(NavigableSet s) {
171          int sum = 0;
172          int iters = s.size();
# Line 226 | Line 221 | public class NavigableSetCheck {
221          reallyAssert(sum == iters-1);
222      }
223  
229
224      static void ktest(NavigableSet s, int size, Integer[] key) {
225          timer.start("Contains               ", size);
226          int sum = 0;
# Line 237 | Line 231 | public class NavigableSetCheck {
231          reallyAssert(sum == size);
232      }
233  
240
234      static void ittest1(NavigableSet s, int size) {
235          int sum = 0;
236          timer.start("Iter Key               ", size);
# Line 268 | Line 261 | public class NavigableSetCheck {
261          rittest1(s, size);
262      }
263  
271
264      static void rtest(NavigableSet s, int size) {
265          timer.start("Remove (iterator)      ", size);
266          for (Iterator it = s.iterator(); it.hasNext(); ) {
# Line 278 | Line 270 | public class NavigableSetCheck {
270          timer.finish();
271      }
272  
281
282
273      static void dtest(NavigableSet s, int size, Integer[] key) {
274          timer.start("Add (addAll)           ", size * 2);
275          NavigableSet s2 = null;
# Line 329 | Line 319 | public class NavigableSetCheck {
319          reallyAssert(s2.isEmpty() && s.isEmpty());
320      }
321  
332
333
322      static void test(NavigableSet s, Integer[] key) {
323          int size = key.length;
324  
# Line 391 | Line 379 | public class NavigableSetCheck {
379              startTime = System.currentTimeMillis();
380          }
381  
394
382          String classify() {
383              if (name.startsWith("Contains"))
384                  return "Contains               ";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines