commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject [06/12] commons-rng git commit: Normalized the seed name in the tests
Date Wed, 28 Sep 2016 22:22:34 GMT
Normalized the seed name in the tests


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/5fe254bb
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/5fe254bb
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/5fe254bb

Branch: refs/heads/master
Commit: 5fe254bb5dba10d407e9796259f10a65b637aa63
Parents: a2aa9ef
Author: Emmanuel Bourg <ebourg@apache.org>
Authored: Wed Sep 28 23:05:12 2016 +0200
Committer: Emmanuel Bourg <ebourg@apache.org>
Committed: Wed Sep 28 23:05:12 2016 +0200

----------------------------------------------------------------------
 .../apache/commons/rng/internal/source32/Well19937aTest.java | 8 ++++----
 .../apache/commons/rng/internal/source32/Well19937cTest.java | 8 ++++----
 .../apache/commons/rng/internal/source32/Well44497aTest.java | 8 ++++----
 .../apache/commons/rng/internal/source32/Well44497bTest.java | 8 ++++----
 .../commons/rng/internal/source64/XorShift1024StarTest.java  | 4 ++--
 5 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5fe254bb/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
index 38c43c5..cfb25c4 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
@@ -28,12 +28,12 @@ public class Well19937aTest {
             0xdc8174cf, 0x3e73a4bc, 0x6fce0775, 0x9e6141fc, 0x5232218a, 0x0fa9e601, 0x0b6fdb4a,
0xf10a0a8c,
             0x97829dba, 0xc60b0778, 0x0566db41, 0x620807aa, 0x599b89c9, 0x1a34942b, 0x6baae3da,
0x4ba0b73d
         };
-        final int[] init = new int[624];
-        for (int i = 0; i < init.length; ++i) {
-            init[i] = base[i % base.length] + i;
+        final int[] seed = new int[624];
+        for (int i = 0; i < seed.length; ++i) {
+            seed[i] = base[i % base.length] + i;
         }
 
-        final Well19937a rng = new Well19937a(init);
+        final Well19937a rng = new Well19937a(seed);
 
         final int[] expectedSequence = {
             0xdb784719, 0xead77ddc, 0x926f567b, 0x95cf8aff, 0x1097e8d5, 0x486a7ca8, 0x97893622,
0xd2a69352, 0x99e777cb, 0xf19f7dea, 0xf7558586, 0x1d8b0188, 0xe1570edd, 0xb43dd614, 0x9e3f95f3,
0x329ee317,

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5fe254bb/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
index 735e681..955d461 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
@@ -28,12 +28,12 @@ public class Well19937cTest {
             0xdc8174cf, 0x3e73a4bc, 0x6fce0775, 0x9e6141fc, 0x5232218a, 0x0fa9e601, 0x0b6fdb4a,
0xf10a0a8c,
             0x97829dba, 0xc60b0778, 0x0566db41, 0x620807aa, 0x599b89c9, 0x1a34942b, 0x6baae3da,
0x4ba0b73d
         };
-        final int[] init = new int[624];
-        for (int i = 0; i < init.length; ++i) {
-            init[i] = base[i % base.length] + i;
+        final int[] seed = new int[624];
+        for (int i = 0; i < seed.length; ++i) {
+            seed[i] = base[i % base.length] + i;
         }
 
-        final Well19937c rng = new Well19937c(init);
+        final Well19937c rng = new Well19937c(seed);
 
         final int[] expectedSequence = {
             0x7edec319, 0x137f7bdc, 0x37c1c37b, 0xfb0d1dff, 0xc1f16ad5, 0x7c4068a8, 0xc0032722,
0x9bee9252, 0xe0c9f2cb, 0xa5b568ea, 0xd4158686, 0x5b0f0588, 0xc15788dd, 0x3a55d414, 0x187504f3,
0x66fc6017,

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5fe254bb/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
index 49dfefe..c148baa 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
@@ -28,12 +28,12 @@ public class Well44497aTest {
             0xdc8174cf, 0x3e73a4bc, 0x6fce0775, 0x9e6141fc, 0x5232218a, 0x0fa9e601, 0x0b6fdb4a,
0xf10a0a8c,
             0x97829dba, 0xc60b0778, 0x0566db41, 0x620807aa, 0x599b89c9, 0x1a34942b, 0x6baae3da,
0x4ba0b73d
         };
-        final int[] init = new int[1391];
-        for (int i = 0; i < init.length; ++i) {
-            init[i] = base[i % base.length] + i;
+        final int[] seed = new int[1391];
+        for (int i = 0; i < seed.length; ++i) {
+            seed[i] = base[i % base.length] + i;
         }
 
-        final Well44497a rng = new Well44497a(init);
+        final Well44497a rng = new Well44497a(seed);
 
         final int[] expectedSequence = {
             0xa8ae884a, 0xa5241b7f, 0x3ad211ce, 0xf526210c, 0xcf2feb2e, 0x97ffba0e, 0x52feddda,
0xf51d0147, 0x8734a1d2, 0x4acbbeb2, 0xe788e18f, 0xad07070d, 0xc6425a56, 0x588f6997, 0xd490294e,
0xf9488e69,

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5fe254bb/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
index 2e59b5a..42b9831 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
@@ -28,12 +28,12 @@ public class Well44497bTest {
             0xdc8174cf, 0x3e73a4bc, 0x6fce0775, 0x9e6141fc, 0x5232218a, 0x0fa9e601, 0x0b6fdb4a,
0xf10a0a8c,
             0x97829dba, 0xc60b0778, 0x0566db41, 0x620807aa, 0x599b89c9, 0x1a34942b, 0x6baae3da,
0x4ba0b73d
         };
-        final int[] init = new int[1391];
-        for (int i = 0; i < init.length; ++i) {
-            init[i] = base[i % base.length] + i;
+        final int[] seed = new int[1391];
+        for (int i = 0; i < seed.length; ++i) {
+            seed[i] = base[i % base.length] + i;
         }
 
-        final Well44497b rng = new Well44497b(init);
+        final Well44497b rng = new Well44497b(seed);
 
         final int[] expectedSequence = {
             0xf9eb8c4a, 0xb5388f7f, 0x31db15ce, 0x7436250c, 0x26ebff2e, 0x5e23be0e, 0x29b3d9da,
0xf79c8147, 0x4565a1d2, 0x1907aeb2, 0x15d9658f, 0x2e86830d, 0x6f4e5a56, 0xeb1ae997, 0xc6852d4e,
0xb11d1a69,

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5fe254bb/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
index 1953cff..67d501d 100644
--- a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
@@ -26,7 +26,7 @@ public class XorShift1024StarTest {
          * Data from running the executable compiled from the author's C code:
          *   http://xorshift.di.unimi.it/xorshift1024star.c
          */
-        final long[] refSeed = new long[] {
+        final long[] seed = new long[] {
             0x012de1babb3c4104L, 0xa5a818b8fc5aa503L, 0xb124ea2b701f4993L, 0x18e0374933d8c782L,
             0x2af8df668d68ad55L, 0x76e56f59daa06243L, 0xf58c016f0f01e30fL, 0x8eeafa41683dbbf4L,
             0x7bf121347c06677fL, 0x4fd0c88d25db5ccbL, 0x99af3be9ebe0a272L, 0x94f2b33b74d0bdcbL,
@@ -46,6 +46,6 @@ public class XorShift1024StarTest {
             0x769997671b2a0158L, 0xfa9cd84e0ffc174dL, 0x34df1cd959dca211L, 0xccea41a33ec1f763L,
         };
 
-        RandomAssert.assertEquals(expectedSequence, new XorShift1024Star(refSeed));
+        RandomAssert.assertEquals(expectedSequence, new XorShift1024Star(seed));
     }
 }


Mime
View raw message