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

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

# Line 37 | Line 37 | public class NavigableMapCheck {
37              }
38          }
39  
40
40          if (args.length > 1)
41              numTests = Integer.parseInt(args[1]);
42  
# Line 46 | Line 45 | public class NavigableMapCheck {
45  
46          System.out.println("Testing " + mapClass.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 NavigableMapCheck {
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(newMap(mapClass), key);
62          }
# Line 77 | Line 74 | public class NavigableMapCheck {
74          }
75      }
76  
80
77      static void runTest(NavigableMap s, Integer[] key) {
78          shuffle(key);
79          int size = key.length;
# Line 171 | Line 167 | public class NavigableMapCheck {
167          reallyAssert(sum == expect);
168      }
169  
174
170      static void t9(NavigableMap s) {
171          int sum = 0;
172          int iters = 20;
# Line 237 | Line 232 | public class NavigableMapCheck {
232          reallyAssert(sum == iters-1);
233      }
234  
240
235      static void ktest(NavigableMap s, int size, Integer[] key) {
236          timer.start("ContainsKey            ", size);
237          Set ks = s.keySet();
# Line 249 | Line 243 | public class NavigableMapCheck {
243          reallyAssert(sum == size);
244      }
245  
252
246      static void ittest1(NavigableMap s, int size) {
247          int sum = 0;
248          timer.start("Iter Key               ", size);
# Line 299 | Line 292 | public class NavigableMapCheck {
292          reallyAssert(sum == size);
293      }
294  
302
295      static void rittest(NavigableMap s, int size) {
296          rittest1(s, size);
297          //        rittest2(s, size);
298      }
299  
308
300      static void rtest(NavigableMap s, int size) {
301          timer.start("Remove (iterator)      ", size);
302          for (Iterator it = s.keySet().iterator(); it.hasNext(); ) {
# Line 324 | Line 315 | public class NavigableMapCheck {
315          timer.finish();
316      }
317  
327
318      static void dtest(NavigableMap s, int size, Integer[] key) {
319          timer.start("Put (putAll)           ", size * 2);
320          NavigableMap s2 = null;
# Line 391 | Line 381 | public class NavigableMapCheck {
381          reallyAssert(s2.isEmpty() && s.isEmpty());
382      }
383  
394
395
384      static void test(NavigableMap s, Integer[] key) {
385          int size = key.length;
386  
# Line 454 | Line 442 | public class NavigableMapCheck {
442              startTime = System.currentTimeMillis();
443          }
444  
457
445          String classify() {
446              if (name.startsWith("Get"))
447                  return "Get                    ";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines