]> git.draconx.ca Git - cdecl99.git/blobdiff - t/rng-test.c
tests: Use 32-bit arithmetic for seed expansion.
[cdecl99.git] / t / rng-test.c
index e4173aac28898df37b5106836bbd67c70770edda..c70f752dc1eee0971defddc9aa5691fa4fecf545 100644 (file)
@@ -33,17 +33,17 @@ int main(void)
 
 int main(void)
 {
-       unsigned long long seed_state = 0xdeadbeeff00dcafe;
        unsigned long long test_result, ref_result;
        unsigned long long ref_state[4], test_state[4];
+       uint_least32_t seed_state = 0xdeadbeef;
        int i, ret = 0;
 
        tap_plan(200);
        for (i = 0; i < 100; i++) {
-               s[0] = ref_state[0] = test_state[0] = splitmix64(&seed_state);
-               s[1] = ref_state[1] = test_state[1] = splitmix64(&seed_state);
-               s[2] = ref_state[2] = test_state[2] = splitmix64(&seed_state);
-               s[3] = ref_state[3] = test_state[3] = splitmix64(&seed_state);
+               s[0] = ref_state[0] = test_state[0] = seed64(&seed_state);
+               s[1] = ref_state[1] = test_state[1] = seed64(&seed_state);
+               s[2] = ref_state[2] = test_state[2] = seed64(&seed_state);
+               s[3] = ref_state[3] = test_state[3] = seed64(&seed_state);
 
                ref_result = next();
                test_result = xoshiro256p(test_state);