for additional coverage and similarity to actual init process.
Followup to #23280.
186@@ -187,6 +187,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
187 throw std::runtime_error("LoadGenesisBlock failed.");
To see if a commit compiles locally, you can use make
. For example this commit indeed fails:
0$ git checkout 1c6f4e6fe07bb111dd40e6ebfb8936f49a51c2e3 && make
1HEAD is now at 1c6f4e6fe0 test: call VerifyLoadedChainstate during ChainTestingSetup
2Making all in src
3make[1]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
4make[2]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
5make[3]: Entering directory '/home/marco/workspace/btc_bitcoin_core'
6make[3]: Leaving directory '/home/marco/workspace/btc_bitcoin_core'
7 CXX test/util/libtest_util_a-setup_common.o
8test/util/setup_common.cpp:192:9: error: use of undeclared identifier 'fReindex'
9 fReindex.load(),
10 ^
111 error generated.
12make[2]: *** [Makefile:11221: test/util/libtest_util_a-setup_common.o] Error 1
13make[2]: Leaving directory '/home/marco/workspace/btc_bitcoin_core/src'
14make[1]: *** [Makefile:17227: all-recursive] Error 1
15make[1]: Leaving directory '/home/marco/workspace/btc_bitcoin_core/src'
16make: *** [Makefile:817: all-recursive] Error 1
194@@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
195 true);
196 assert(!rv.has_value());
197
198+ auto rv2 = VerifyLoadedChainstate(
194@@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
195 true);
196 assert(!rv.has_value());
197
198+ auto rv2 = VerifyLoadedChainstate(
199+ *Assert(m_node.chainman.get()),
0 *Assert(m_node.chainman),
I think this should also compile?
200+ fReindex.load(),
201+ m_args.GetBoolArg("-reindex-chainstate", false),
202+ chainparams.GetConsensus(),
203+ m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS),
204+ m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL),
205+ GetAdjustedTime);
for additional coverage and similarity to actual init process.
jamesob
MarcoFalke
ryanofsky
dongcarl
Labels
Tests