Skip to content

Commit 1427188

Browse files
committed
test: Default initialize should_freeze to true
It is safe now, when move semantics is used instead of a custom swap function.
1 parent c684336 commit 1427188

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/test/checkqueue_tests.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ struct FrozenCleanupCheck {
108108
static std::atomic<uint64_t> nFrozen;
109109
static std::condition_variable cv;
110110
static std::mutex m;
111-
// Freezing can't be the default initialized behavior given how the queue
112-
// swaps in default initialized Checks.
113-
bool should_freeze {false};
111+
bool should_freeze{true};
114112
bool operator()() const
115113
{
116114
return true;
@@ -333,10 +331,6 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
333331
std::thread t0([&]() {
334332
CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
335333
std::vector<FrozenCleanupCheck> vChecks(1);
336-
// Freezing can't be the default initialized behavior given how the queue
337-
// swaps in default initialized Checks (otherwise freezing destructor
338-
// would get called twice).
339-
vChecks[0].should_freeze = true;
340334
control.Add(std::move(vChecks));
341335
bool waitResult = control.Wait(); // Hangs here
342336
assert(waitResult);

0 commit comments

Comments
 (0)