Changeset View
Changeset View
Standalone View
Standalone View
src/test/checkqueue_tests.cpp
Show All 15 Lines | |||||
#include <vector> | #include <vector> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <memory> | #include <memory> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
#include <utility> | #include <utility> | ||||
BOOST_FIXTURE_TEST_SUITE(checkqueue_tests, TestingSetup) | /** | ||||
* Identical to TestingSetup but excludes lock contention logging if | |||||
* `DEBUG_LOCKCONTENTION` is defined, as some of these tests are designed to be | |||||
* heavily contested to trigger race conditions or other issues. | |||||
*/ | |||||
struct NoLockLoggingTestingSetup : public TestingSetup { | |||||
NoLockLoggingTestingSetup() | |||||
#ifdef DEBUG_LOCKCONTENTION | |||||
: TestingSetup{CBaseChainParams::MAIN, /*extra_args=*/{ | |||||
"-debugexclude=lock" | |||||
}} { | |||||
} | |||||
#else | |||||
: TestingSetup{CBaseChainParams::MAIN} { | |||||
} | |||||
#endif | |||||
}; | |||||
BOOST_FIXTURE_TEST_SUITE(checkqueue_tests, NoLockLoggingTestingSetup) | |||||
static const unsigned int QUEUE_BATCH_SIZE = 128; | static const unsigned int QUEUE_BATCH_SIZE = 128; | ||||
static const int SCRIPT_CHECK_THREADS = 3; | static const int SCRIPT_CHECK_THREADS = 3; | ||||
struct FakeCheck { | struct FakeCheck { | ||||
bool operator()() const { return true; } | bool operator()() const { return true; } | ||||
void swap(FakeCheck &x){}; | void swap(FakeCheck &x){}; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |