Commit b57f2cfd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more tests

parent 6e9dca27
Pipeline #71955 passed with stages
in 15 minutes and 7 seconds
......@@ -80,6 +80,19 @@ def test_rand5():
np.testing.assert_equal(a,b)
np.testing.assert_equal(c,d)
def test_rand5b():
with ift.random.Context(31):
a = ift.random.current_rng().integers(0,1000000000)
with ift.random.Context(31):
b = ift.random.current_rng().integers(0,1000000000)
c = ift.random.current_rng().integers(0,1000000000)
d = ift.random.current_rng().integers(0,1000000000)
check_state_back_to_orig()
np.testing.assert_equal(a,b)
np.testing.assert_equal(c,d)
def test_rand6():
ift.random.push_sseq_from_seed(31)
state = ift.random.getState()
......@@ -90,3 +103,12 @@ def test_rand6():
ift.random.pop_sseq()
check_state_back_to_orig()
def test_rand6b():
with ift.random.Context(31):
state = ift.random.getState()
a = ift.random.current_rng().integers(0,1000000000)
ift.random.setState(state)
b = ift.random.current_rng().integers(0,1000000000)
np.testing.assert_equal(a,b)
check_state_back_to_orig()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment