aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-04-08 10:11:46 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-04-08 10:11:46 -0400
commit13d2a33537a403ac47a989be92109d3214375b6a (patch)
tree0f20619eec2ab5d28fbf3bd2e00fb3fae656ceef /src
parent1f70185a809362117a8158e386fdead85728794f (diff)
downloadbitcoin-13d2a33537a403ac47a989be92109d3214375b6a.tar.xz
Fix unregister_all_during_call cleanup
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <fanquake@gmail.com> https://github.com/bitcoin/bitcoin/pull/18551#issuecomment-610974251
Diffstat (limited to 'src')
-rw-r--r--src/test/validationinterface_tests.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/test/validationinterface_tests.cpp b/src/test/validationinterface_tests.cpp
index b4aa2f0f3a..208be92852 100644
--- a/src/test/validationinterface_tests.cpp
+++ b/src/test/validationinterface_tests.cpp
@@ -3,14 +3,14 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/test/unit_test.hpp>
-
#include <consensus/validation.h>
#include <primitives/block.h>
#include <scheduler.h>
+#include <test/util/setup_common.h>
#include <util/check.h>
#include <validationinterface.h>
-BOOST_AUTO_TEST_SUITE(validationinterface_tests)
+BOOST_FIXTURE_TEST_SUITE(validationinterface_tests, TestingSetup)
class TestInterface : public CValidationInterface
{
@@ -43,9 +43,6 @@ public:
BOOST_AUTO_TEST_CASE(unregister_all_during_call)
{
bool destroyed = false;
-
- CScheduler scheduler;
- GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);
RegisterSharedValidationInterface(std::make_shared<TestInterface>(
[&] {
// First call should decrements reference count 2 -> 1