From 81f5ade2a324167c03c5ce765a26bd42ed652723 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 22 Jan 2023 09:57:19 -0800 Subject: [PATCH 1/3] Move random test util code from setup_common to random as many of the unit tests don't use this code --- src/Makefile.test_util.include | 1 + src/test/base58_tests.cpp | 1 + src/test/blockencodings_tests.cpp | 1 + src/test/bloom_tests.cpp | 1 + src/test/checkqueue_tests.cpp | 1 + src/test/coins_tests.cpp | 1 + src/test/crypto_tests.cpp | 1 + src/test/cuckoocache_tests.cpp | 2 + src/test/dbwrapper_tests.cpp | 1 + src/test/hash_tests.cpp | 1 + src/test/key_tests.cpp | 1 + src/test/merkle_tests.cpp | 1 + src/test/miner_tests.cpp | 1 + src/test/minisketch_tests.cpp | 1 + src/test/orphanage_tests.cpp | 1 + src/test/pmt_tests.cpp | 1 + src/test/pow_tests.cpp | 1 + src/test/prevector_tests.cpp | 1 + src/test/script_tests.cpp | 1 + src/test/serfloat_tests.cpp | 1 + src/test/sighash_tests.cpp | 1 + src/test/skiplist_tests.cpp | 1 + src/test/streams_tests.cpp | 1 + src/test/transaction_tests.cpp | 1 + src/test/txpackage_tests.cpp | 1 + src/test/txrequest_tests.cpp | 1 + src/test/util/random.h | 39 +++++++++++++++++++ src/test/util/setup_common.h | 6 --- src/test/util_tests.cpp | 1 + src/test/validation_block_tests.cpp | 1 + src/test/validation_chainstate_tests.cpp | 1 + .../validation_chainstatemanager_tests.cpp | 1 + src/test/validation_flush_tests.cpp | 1 + src/test/versionbits_tests.cpp | 1 + src/wallet/test/wallet_crypto_tests.cpp | 1 + 35 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 src/test/util/random.h diff --git a/src/Makefile.test_util.include b/src/Makefile.test_util.include index 8496b3698ac..257ecb5542d 100644 --- a/src/Makefile.test_util.include +++ b/src/Makefile.test_util.include @@ -14,6 +14,7 @@ TEST_UTIL_H = \ test/util/logging.h \ test/util/mining.h \ test/util/net.h \ + test/util/random.h \ test/util/script.h \ test/util/setup_common.h \ test/util/str.h \ diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 601caf81026..7f3ca6bf931 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp index e23b7228e7e..4348a20886f 100644 --- a/src/test/blockencodings_tests.cpp +++ b/src/test/blockencodings_tests.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 48880412044..5d4c5eea0e1 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp index 53fbc26e153..135f107159c 100644 --- a/src/test/checkqueue_tests.cpp +++ b/src/test/checkqueue_tests.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 55ecd41af10..e91ea3536d0 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -6,6 +6,7 @@ #include #include