You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/08/06 10:42:27 UTC

[commons-rng] 04/07: RNG-85: Add MSWS to the tests.

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 2c550c8907856f97c0cd86c8f5f4d0d97bcebfb9
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Mon Aug 5 11:52:41 2019 +0100

    RNG-85: Add MSWS to the tests.
    
    This requires an exclusion for the test of self-seeding functionality.
---
 .../org/apache/commons/rng/simple/ProvidersCommonParametricTest.java   | 2 ++
 .../src/test/java/org/apache/commons/rng/simple/ProvidersList.java     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index f54345f..ff12153 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -126,6 +126,8 @@ public class ProvidersCommonParametricTest {
     public void testEmptyLongArraySeed() {
         final long[] empty = new long[0];
         Assume.assumeTrue(originalSource.isNativeSeed(empty));
+        // The Middle-Square Weyl Sequence generator cannot self-seed
+        Assume.assumeFalse(originalSource == RandomSource.MSWS);
 
         // Exercise the default seeding procedure.
         final UniformRandomProvider rng = RandomSource.create(originalSource, empty, originalArgs);
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
index 8884b8e..698b8c9 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersList.java
@@ -60,6 +60,9 @@ public final class ProvidersList {
             add(LIST32, RandomSource.PCG_XSH_RS_32, new long[] {259L, 2861L});
             add(LIST32, RandomSource.PCG_MCG_XSH_RS_32, 9678L);
             add(LIST32, RandomSource.PCG_MCG_XSH_RR_32, 2578291L);
+            // Ensure a high complexity increment is used for the Weyl sequence otherwise
+            // it will not output random data.
+            add(LIST32, RandomSource.MSWS, new long[] {687233648L, 678656564562300L, 0xb5ad4eceda1ce2a9L});
             // ... add more here.
 
             // "long"-based RNGs.