scripted-diff: [test] Use g_rng/m_rng directly

-BEGIN VERIFY SCRIPT-

 # Use m_rng in unit test files
 ren() { sed -i "s:\<$1\>:$2:g" $( git grep -l "$1" src/test/*.cpp src/wallet/test/*.cpp src/test/util/setup_common.cpp ) ; }
 ren InsecureRand32                m_rng.rand32
 ren InsecureRand256               m_rng.rand256
 ren InsecureRandBits              m_rng.randbits
 ren InsecureRandRange             m_rng.randrange
 ren InsecureRandBool              m_rng.randbool
 ren g_insecure_rand_ctx           m_rng
 ren g_insecure_rand_ctx_temp_path g_rng_temp_path

-END VERIFY SCRIPT-
This commit is contained in:
MarcoFalke
2024-08-02 11:35:15 +02:00
parent fa54cab473
commit fa0fe08eca
40 changed files with 286 additions and 286 deletions

View File

@@ -19,11 +19,11 @@ BOOST_FIXTURE_TEST_SUITE(minisketch_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(minisketch_test)
{
for (int i = 0; i < 100; ++i) {
uint32_t errors = 0 + InsecureRandRange(11);
uint32_t start_a = 1 + InsecureRandRange(1000000000);
uint32_t a_not_b = InsecureRandRange(errors + 1);
uint32_t errors = 0 + m_rng.randrange(11);
uint32_t start_a = 1 + m_rng.randrange(1000000000);
uint32_t a_not_b = m_rng.randrange(errors + 1);
uint32_t b_not_a = errors - a_not_b;
uint32_t both = InsecureRandRange(10000);
uint32_t both = m_rng.randrange(10000);
uint32_t end_a = start_a + a_not_b + both;
uint32_t start_b = start_a + a_not_b;
uint32_t end_b = start_b + both + b_not_a;