Skip to content

Commit 3e8bf2e

Browse files
committed
test: make assumeUTXO test capture the expected fatal error
The test is exercising the error, so it can capture it before the test framework displays it on the console as an unforeseen fatal error.
1 parent 79e8247 commit 3e8bf2e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/validation_chainstatemanager_tests.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <rpc/blockchain.h>
1111
#include <sync.h>
1212
#include <test/util/chainstate.h>
13+
#include <test/util/logging.h>
1314
#include <test/util/random.h>
1415
#include <test/util/setup_common.h>
1516
#include <timedata.h>
@@ -659,8 +660,11 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_completion_hash_mismatch, Sna
659660
fs::path snapshot_chainstate_dir = gArgs.GetDataDirNet() / "chainstate_snapshot";
660661
BOOST_CHECK(fs::exists(snapshot_chainstate_dir));
661662

662-
res = WITH_LOCK(::cs_main, return chainman.MaybeCompleteSnapshotValidation());
663-
BOOST_CHECK_EQUAL(res, SnapshotCompletionResult::HASH_MISMATCH);
663+
{
664+
ASSERT_DEBUG_LOG("failed to validate the -assumeutxo snapshot state");
665+
res = WITH_LOCK(::cs_main, return chainman.MaybeCompleteSnapshotValidation());
666+
BOOST_CHECK_EQUAL(res, SnapshotCompletionResult::HASH_MISMATCH);
667+
}
664668

665669
auto all_chainstates = chainman.GetAll();
666670
BOOST_CHECK_EQUAL(all_chainstates.size(), 1);

0 commit comments

Comments
 (0)