aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-21 13:03:41 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-21 13:03:41 +0000
commit6c2d5972f3544c4f3e987828a99e88f27b62cf87 (patch)
tree276783d4e29f3c05ed5e23257b33c65befbc911d /src/test
parent06820032142a75cc3c5b832045058bc6f6f74786 (diff)
refactor: Use move semantics in `CCheckQueue::Add`
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/checkqueue_tests.cpp11
-rw-r--r--src/test/fuzz/checkqueue.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp
index 135f107159..90154c8757 100644
--- a/src/test/checkqueue_tests.cpp
+++ b/src/test/checkqueue_tests.cpp
@@ -140,6 +140,17 @@ struct FrozenCleanupCheck {
cv.wait(l, []{ return nFrozen.load(std::memory_order_relaxed) == 0;});
}
}
+ FrozenCleanupCheck(FrozenCleanupCheck&& other) noexcept
+ {
+ should_freeze = other.should_freeze;
+ other.should_freeze = false;
+ }
+ FrozenCleanupCheck& operator=(FrozenCleanupCheck&& other) noexcept
+ {
+ should_freeze = other.should_freeze;
+ other.should_freeze = false;
+ return *this;
+ }
void swap(FrozenCleanupCheck& x) noexcept
{
std::swap(should_freeze, x.should_freeze);
diff --git a/src/test/fuzz/checkqueue.cpp b/src/test/fuzz/checkqueue.cpp
index 6256aefaa3..0c776e1b2f 100644
--- a/src/test/fuzz/checkqueue.cpp
+++ b/src/test/fuzz/checkqueue.cpp
@@ -13,7 +13,7 @@
namespace {
struct DumbCheck {
- const bool result = false;
+ bool result = false;
DumbCheck() = default;