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).
Worked around #21005
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
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.
Rebased (3x)
concept ack (1x)
Rebased (4x)
Rebased (5x)
Concept ACK (2x)
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)};
This seems kind of unruly.
unruly
C++ requires this. (You can't use auto for non-static members)
ACK fa576b4532814b4bca1936d170cabd01fbc51960
Light Code-Review ACK fa576b4532814b4bca1936d170cabd01fbc51960
Looks reasonable. Always good to coalesce these init codepaths.
Failed merged (1x)
This need fixing up post #19203 & #19288:
test/fuzz/socks5.cpp:22:66: error: unknown type name 'BasicTestingSetup'
static const auto testing_setup = MakeNoLogFileContext<const BasicTestingSetup>();
^
1 error generated.
gmake[2]: *** [Makefile:13693: test/fuzz/fuzz-socks5.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
test/fuzz/torcontrol.cpp:38:39: error: use of undeclared identifier 'MakeNoLogFileContext'
static const auto testing_setup = MakeNoLogFileContext<>();
^
1 error generated.
diff --git a/src/test/fuzz/socks5.cpp b/src/test/fuzz/socks5.cpp
index 123ee042e..72c3e8f71 100644
--- a/src/test/fuzz/socks5.cpp
+++ b/src/test/fuzz/socks5.cpp
@@ -6,6 +6,7 @@
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
+#include <test/util/setup_common.h>
#include <cstdint>
#include <string>
diff --git a/src/test/fuzz/torcontrol.cpp b/src/test/fuzz/torcontrol.cpp
index b7a42ea7f..a8e69dee3 100644
--- a/src/test/fuzz/torcontrol.cpp
+++ b/src/test/fuzz/torcontrol.cpp
@@ -5,6 +5,7 @@
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
+#include <test/util/setup_common.h>
#include <torcontrol.h>
#include <cstdint>
Not going to invalidate the precious reviews over an unrelated issue. Fixed in #21358, which can go in first.