aboutsummaryrefslogtreecommitdiff
path: root/src/test/checkqueue_tests.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-21 13:05:00 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-21 13:05:00 +0000
commit95ad70ab652ddde7de65f633c36c1378b26a313a (patch)
treed11a85db4d5d5aa8773ff6466a645cd5ff27be44 /src/test/checkqueue_tests.cpp
parentcea50521fe810111a8a3c84ad14f944eafb5b658 (diff)
test: Default initialize `should_freeze` to `true`
It is safe now, when move semantics is used instead of a custom swap function.
Diffstat (limited to 'src/test/checkqueue_tests.cpp')
-rw-r--r--src/test/checkqueue_tests.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp
index e99a880280..012b0eb321 100644
--- a/src/test/checkqueue_tests.cpp
+++ b/src/test/checkqueue_tests.cpp
@@ -109,9 +109,7 @@ struct FrozenCleanupCheck {
static std::atomic<uint64_t> nFrozen;
static std::condition_variable cv;
static std::mutex m;
- // Freezing can't be the default initialized behavior given how the queue
- // swaps in default initialized Checks.
- bool should_freeze {false};
+ bool should_freeze{true};
bool operator()() const
{
return true;
@@ -344,10 +342,6 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
std::thread t0([&]() {
CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
std::vector<FrozenCleanupCheck> vChecks(1);
- // Freezing can't be the default initialized behavior given how the queue
- // swaps in default initialized Checks (otherwise freezing destructor
- // would get called twice).
- vChecks[0].should_freeze = true;
control.Add(std::move(vChecks));
bool waitResult = control.Wait(); // Hangs here
assert(waitResult);