aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-07-07 17:45:30 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-07-08 11:45:34 -0300
commit3e8bf2e10c26ef9c2f58307b523e4b674ac97a2c (patch)
tree4593e9c563876547e0286110e02791977e507a44 /src
parent79e8247ddb166f9b980f40249b7372a502402a4d (diff)
downloadbitcoin-3e8bf2e10c26ef9c2f58307b523e4b674ac97a2c.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/test/validation_chainstatemanager_tests.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/validation_chainstatemanager_tests.cpp b/src/test/validation_chainstatemanager_tests.cpp
index 8f46d54621..99860961a2 100644
--- a/src/test/validation_chainstatemanager_tests.cpp
+++ b/src/test/validation_chainstatemanager_tests.cpp
@@ -10,6 +10,7 @@
#include <rpc/blockchain.h>
#include <sync.h>
#include <test/util/chainstate.h>
+#include <test/util/logging.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <timedata.h>
@@ -659,8 +660,11 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_completion_hash_mismatch, Sna
fs::path snapshot_chainstate_dir = gArgs.GetDataDirNet() / "chainstate_snapshot";
BOOST_CHECK(fs::exists(snapshot_chainstate_dir));
- res = WITH_LOCK(::cs_main, return chainman.MaybeCompleteSnapshotValidation());
- BOOST_CHECK_EQUAL(res, SnapshotCompletionResult::HASH_MISMATCH);
+ {
+ ASSERT_DEBUG_LOG("failed to validate the -assumeutxo snapshot state");
+ res = WITH_LOCK(::cs_main, return chainman.MaybeCompleteSnapshotValidation());
+ BOOST_CHECK_EQUAL(res, SnapshotCompletionResult::HASH_MISMATCH);
+ }
auto all_chainstates = chainman.GetAll();
BOOST_CHECK_EQUAL(all_chainstates.size(), 1);