From 13d2a33537a403ac47a989be92109d3214375b6a Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Wed, 8 Apr 2020 10:11:46 -0400 Subject: 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 https://github.com/bitcoin/bitcoin/pull/18551#issuecomment-610974251 --- src/test/validationinterface_tests.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/test/validationinterface_tests.cpp') diff --git a/src/test/validationinterface_tests.cpp b/src/test/validationinterface_tests.cpp index b4aa2f0f3..208be9285 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 - #include #include #include +#include #include #include -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( [&] { // First call should decrements reference count 2 -> 1 -- cgit v1.2.3