From eac76e373dda292d970171d20df3402ee997d027 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 8 Apr 2020 00:40:52 +0100 Subject: [PATCH] t/t-rand.py: Set the correct refernce seed value for `dsarand'. The number of steps taken is different on 32- and 64-bit platforms, with no especially easy way to calculate it in a principled way. Just use a stupid case analysis to get the right answer. --- t/t-rand.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/t-rand.py b/t/t-rand.py index d8d7b00..a45c1d5 100644 --- a/t/t-rand.py +++ b/t/t-rand.py @@ -121,7 +121,10 @@ class TestRandomGenerator (U.TestCase): n = C.MP.loadb(seed) rng = C.DSARand(seed) me.check_rand(rng) - me.assertEqual(rng.seed, (n + 153 + 3).storeb(16)) + if T.MAXFIXNUM == (1 << 31) - 1: steps = 153 + 3 + elif T.MAXFIXNUM == (1 << 63) - 1: steps = 153 + else: steps = None + if steps is not None: me.assertEqual(rng.seed, (n + steps).storeb(16)) def test_bbs(me): ev = T.EventRecorder() -- 2.11.0