To avoid verbose code duplication, which may lead to accidental mishaps https://github.com/bitcoin/bitcoin/pull/20998/files#r563624041.
Also fix a nit I found in #20946 (review).
To avoid verbose code duplication, which may lead to accidental mishaps https://github.com/bitcoin/bitcoin/pull/20998/files#r563624041.
Also fix a nit I found in #20946 (review).
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Can be reviewed with --color-moved=dimmed-zebra
14@@ -15,7 +15,7 @@
15 namespace {
16
17 struct TestBlockAndIndex {
18- TestingSetup test_setup{};
19+ const std::unique_ptr<const TestingSetup> testing_setup{MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN)};
unruly
C++ requires this. (You can’t use auto
for non-static members)
Light Code-Review ACK fa576b4532814b4bca1936d170cabd01fbc51960
Looks reasonable. Always good to coalesce these init codepaths.
Failed merged (1x)
This need fixing up post #19203 & #19288:
0test/fuzz/socks5.cpp:22:66: error: unknown type name 'BasicTestingSetup'
1 static const auto testing_setup = MakeNoLogFileContext<const BasicTestingSetup>();
2 ^
31 error generated.
4gmake[2]: *** [Makefile:13693: test/fuzz/fuzz-socks5.o] Error 1
5gmake[2]: *** Waiting for unfinished jobs....
6test/fuzz/torcontrol.cpp:38:39: error: use of undeclared identifier 'MakeNoLogFileContext'
7 static const auto testing_setup = MakeNoLogFileContext<>();
8 ^
91 error generated.
0diff --git a/src/test/fuzz/socks5.cpp b/src/test/fuzz/socks5.cpp
1index 123ee042e..72c3e8f71 100644
2--- a/src/test/fuzz/socks5.cpp
3+++ b/src/test/fuzz/socks5.cpp
4@@ -6,6 +6,7 @@
5 #include <test/fuzz/FuzzedDataProvider.h>
6 #include <test/fuzz/fuzz.h>
7 #include <test/fuzz/util.h>
8+#include <test/util/setup_common.h>
9
10 #include <cstdint>
11 #include <string>
12diff --git a/src/test/fuzz/torcontrol.cpp b/src/test/fuzz/torcontrol.cpp
13index b7a42ea7f..a8e69dee3 100644
14--- a/src/test/fuzz/torcontrol.cpp
15+++ b/src/test/fuzz/torcontrol.cpp
16@@ -5,6 +5,7 @@
17 #include <test/fuzz/FuzzedDataProvider.h>
18 #include <test/fuzz/fuzz.h>
19 #include <test/fuzz/util.h>
20+#include <test/util/setup_common.h>
21 #include <torcontrol.h>
22
23 #include <cstdint>