Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Typedefs | Functions | Variables
checkqueue_tests.cpp File Reference
#include <checkqueue.h>
#include <sync.h>
#include <test/util/setup_common.h>
#include <util/system.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  FakeCheck
 
struct  FakeCheckCheckCompletion
 
struct  FailingCheck
 
struct  UniqueCheck
 
struct  MemoryCheck
 
struct  FrozenCleanupCheck
 

Typedefs

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

Functions

static void Correct_Queue_range (std::vector< size_t > range)
 This test case checks that the CCheckQueue works properly with each specified size_t Checks pushed. More...
 
 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 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 135 of file checkqueue_tests.cpp.

◆ Failing_Queue

Definition at line 137 of file checkqueue_tests.cpp.

◆ FrozenCleanup_Queue

Definition at line 140 of file checkqueue_tests.cpp.

◆ Memory_Queue

Definition at line 139 of file checkqueue_tests.cpp.

◆ Standard_Queue

Definition at line 136 of file checkqueue_tests.cpp.

◆ Unique_Queue

Definition at line 138 of file checkqueue_tests.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Catches_Failure  )

Test that failing checks are caught.

Definition at line 206 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 187 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_One  )

Test that 1 check is correct.

Definition at line 179 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ 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 195 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_Correct_Zero  )

Test that 0 checks is correct.

Definition at line 171 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/10]

BOOST_AUTO_TEST_CASE ( test_CheckQueue_FrozenCleanup  )

Definition at line 320 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 293 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 234 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 258 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 360 of file checkqueue_tests.cpp.

Here is the call graph for this function:

◆ Correct_Queue_range()

static void Correct_Queue_range ( std::vector< size_t >  range)
static

This test case checks that the CCheckQueue works properly with each specified size_t Checks pushed.

Definition at line 146 of file checkqueue_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ QUEUE_BATCH_SIZE

const unsigned int QUEUE_BATCH_SIZE = 128
static

Definition at line 23 of file checkqueue_tests.cpp.

◆ SCRIPT_CHECK_THREADS

const int SCRIPT_CHECK_THREADS = 3
static

Definition at line 24 of file checkqueue_tests.cpp.