changeset 201:9954a543d607

Shun the BlackholeTest.
author shade
date Wed, 09 Oct 2013 15:51:15 +0400
parents 912eff52db80
children 01fe2ffe529a
files jmh-core/src/test/java/org/openjdk/jmh/BlackholeTest.java
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/test/java/org/openjdk/jmh/BlackholeTest.java	Wed Oct 09 15:45:14 2013 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/BlackholeTest.java	Wed Oct 09 15:51:15 2013 +0400
@@ -31,9 +31,15 @@
     @Test
     public void test() {
         long tlr = 0;
-        for (int t = 0; t < 1000; t++) {
-            tlr = (tlr << 1) + 1;
-            System.out.println(tlr);
+        long tlrMask = 0;
+        for (int t = 0; t < 1000000000; t++) {
+            tlr = (tlr * 6364136223846793005L + 1442695040888963407L);
+            if ((tlr & tlrMask) == 0) {
+                // SHOULD ALMOST NEVER HAPPEN IN MEASUREMENT
+                tlrMask = (tlrMask << 1) + 1;
+                tlr = 0;
+//                System.out.println(t);
+            }
         }
     }