Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Typedefs | Functions | Variables
checkqueue_tests.cpp File Reference
#include <checkqueue.h>
#include <common/args.h>
#include <sync.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <util/chaintype.h>
#include <util/time.h>
#include <boost/test/unit_test.hpp>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <thread>
#include <unordered_set>
#include <utility>
#include <vector>
Include dependency graph for checkqueue_tests.cpp:

Go to the source code of this file.

Classes

struct  NoLockLoggingTestingSetup
 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. More...
 
struct  CheckQueueTest
 
struct  FakeCheck
 
struct  FakeCheckCheckCompletion
 
struct  FixedCheck
 
struct  UniqueCheck
 
struct  MemoryCheck
 
struct  FrozenCleanupCheck
 

Typedefs

typedef CCheckQueue< FakeCheckCheckCompletionCorrect_Queue
 
typedef CCheckQueue< FakeCheckStandard_Queue
 
typedef CCheckQueue< FixedCheckFixed_Queue
 
typedef CCheckQueue< UniqueCheckUnique_Queue
 
typedef CCheckQueue< MemoryCheckMemory_Queue
 
typedef CCheckQueue< FrozenCleanupCheckFrozenCleanup_Queue
 

Functions

 BOOST_AUTO_TEST_CASE (test_CheckQueue_Correct_Zero)
 Test that 0 checks is correct. More...
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Correct_One)
 Test that 1 check is correct. More...
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Correct_Max)
 Test that MAX check is correct. More...
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Correct_Random)
 Test that random numbers of checks are correct. More...
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Catches_Failure)
 Test that distinct failing checks are caught. More...
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Recovers_From_Failure)
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_UniqueCheck)
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_Memory)
 
 BOOST_AUTO_TEST_CASE (test_CheckQueue_FrozenCleanup)
 
 BOOST_AUTO_TEST_CASE (test_CheckQueueControl_Locks)
 Test that CCheckQueueControl is threadsafe. More...
 

Variables

static const unsigned int QUEUE_BATCH_SIZE = 128
 
static const int SCRIPT_CHECK_THREADS = 3
 

Typedef Documentation

◆ Correct_Queue

Definition at line 148 of file checkqueue_tests.cpp.

◆ Fixed_Queue

Definition at line 150 of file checkqueue_tests.cpp.

◆ FrozenCleanup_Queue

Definition at line 153 of file checkqueue_tests.cpp.

◆ Memory_Queue

Definition at line 152 of file checkqueue_tests.cpp.

◆ Standard_Queue

Definition at line 149 of file checkqueue_tests.cpp.

◆ Unique_Queue

Definition at line 151 of file checkqueue_tests.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Catches_Failure  )

Test that distinct failing checks are caught.

Definition at line 219 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_Max  )

Test that MAX check is correct.

Definition at line 200 of file checkqueue_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_One  )

Test that 1 check is correct.

Definition at line 192 of file checkqueue_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_Random  )

Test that random numbers of checks are correct.

Definition at line 208 of file checkqueue_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_Zero  )

Test that 0 checks is correct.

Definition at line 184 of file checkqueue_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [6/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_FrozenCleanup  )

Definition at line 322 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Memory  )

Definition at line 297 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Recovers_From_Failure  )

Definition at line 244 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_UniqueCheck  )

Definition at line 265 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueueControl_Locks  )

Test that CCheckQueueControl is threadsafe.

Definition at line 356 of file checkqueue_tests.cpp.

Here is the call graph for this function:

Variable Documentation

◆ QUEUE_BATCH_SIZE

const unsigned int QUEUE_BATCH_SIZE = 128
static

Definition at line 41 of file checkqueue_tests.cpp.

◆ SCRIPT_CHECK_THREADS

const int SCRIPT_CHECK_THREADS = 3
static

Definition at line 42 of file checkqueue_tests.cpp.