Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Functions
addrman_tests.cpp File Reference
#include <addrdb.h>
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <hash.h>
#include <netbase.h>
#include <random.h>
#include <test/data/asmap.raw.h>
#include <test/util/setup_common.h>
#include <util/asmap.h>
#include <util/string.h>
#include <boost/test/unit_test.hpp>
#include <optional>
#include <string>
Include dependency graph for addrman_tests.cpp:

Go to the source code of this file.

Classes

class  CAddrManSerializationMock
 
class  CAddrManUncorrupted
 
class  CAddrManCorrupted
 
class  CAddrManTest
 

Functions

static CDataStream AddrmanToStream (const CAddrManSerializationMock &_addrman)
 
static CNetAddr ResolveIP (const std::string &ip)
 
static CService ResolveService (const std::string &ip, uint16_t port=0)
 
static std::vector< bool > FromBytes (const unsigned char *source, int vector_size)
 
 BOOST_AUTO_TEST_CASE (addrman_simple)
 
 BOOST_AUTO_TEST_CASE (addrman_ports)
 
 BOOST_AUTO_TEST_CASE (addrman_select)
 
 BOOST_AUTO_TEST_CASE (addrman_new_collisions)
 
 BOOST_AUTO_TEST_CASE (addrman_tried_collisions)
 
 BOOST_AUTO_TEST_CASE (addrman_find)
 
 BOOST_AUTO_TEST_CASE (addrman_create)
 
 BOOST_AUTO_TEST_CASE (addrman_delete)
 
 BOOST_AUTO_TEST_CASE (addrman_getaddr)
 
 BOOST_AUTO_TEST_CASE (caddrinfo_get_tried_bucket_legacy)
 
 BOOST_AUTO_TEST_CASE (caddrinfo_get_new_bucket_legacy)
 
 BOOST_AUTO_TEST_CASE (caddrinfo_get_tried_bucket)
 
 BOOST_AUTO_TEST_CASE (caddrinfo_get_new_bucket)
 
 BOOST_AUTO_TEST_CASE (addrman_serialization)
 
 BOOST_AUTO_TEST_CASE (remove_invalid)
 
 BOOST_AUTO_TEST_CASE (addrman_selecttriedcollision)
 
 BOOST_AUTO_TEST_CASE (addrman_noevict)
 
 BOOST_AUTO_TEST_CASE (addrman_evictionworks)
 
 BOOST_AUTO_TEST_CASE (load_addrman)
 
 BOOST_AUTO_TEST_CASE (load_addrman_corrupted)
 

Function Documentation

◆ AddrmanToStream()

static CDataStream AddrmanToStream ( const CAddrManSerializationMock _addrman)
static

Definition at line 69 of file addrman_tests.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [1/20]

BOOST_AUTO_TEST_CASE ( addrman_create  )

Definition at line 390 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/20]

BOOST_AUTO_TEST_CASE ( addrman_delete  )

Definition at line 410 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/20]

BOOST_AUTO_TEST_CASE ( addrman_evictionworks  )

Definition at line 952 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/20]

BOOST_AUTO_TEST_CASE ( addrman_find  )

Definition at line 357 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/20]

BOOST_AUTO_TEST_CASE ( addrman_getaddr  )

Definition at line 430 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/20]

BOOST_AUTO_TEST_CASE ( addrman_new_collisions  )

Definition at line 298 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/20]

BOOST_AUTO_TEST_CASE ( addrman_noevict  )

Definition at line 896 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/20]

BOOST_AUTO_TEST_CASE ( addrman_ports  )

Definition at line 210 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/20]

BOOST_AUTO_TEST_CASE ( addrman_select  )

Definition at line 239 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/20]

BOOST_AUTO_TEST_CASE ( addrman_selecttriedcollision  )

Definition at line 864 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/20]

BOOST_AUTO_TEST_CASE ( addrman_serialization  )

Definition at line 758 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/20]

BOOST_AUTO_TEST_CASE ( addrman_simple  )

Definition at line 166 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/20]

BOOST_AUTO_TEST_CASE ( addrman_tried_collisions  )

Definition at line 327 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/20]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_new_bucket  )

Definition at line 678 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/20]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_new_bucket_legacy  )

Definition at line 545 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/20]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_tried_bucket  )

Definition at line 623 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/20]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_tried_bucket_legacy  )

Definition at line 490 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/20]

BOOST_AUTO_TEST_CASE ( load_addrman  )

Definition at line 1006 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [19/20]

BOOST_AUTO_TEST_CASE ( load_addrman_corrupted  )

Definition at line 1051 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [20/20]

BOOST_AUTO_TEST_CASE ( remove_invalid  )

Definition at line 823 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ FromBytes()

static std::vector<bool> FromBytes ( const unsigned char *  source,
int  vector_size 
)
static

Definition at line 152 of file addrman_tests.cpp.

Here is the caller graph for this function:

◆ ResolveIP()

static CNetAddr ResolveIP ( const std::string &  ip)
static

Definition at line 137 of file addrman_tests.cpp.

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

◆ ResolveService()

static CService ResolveService ( const std::string &  ip,
uint16_t  port = 0 
)
static

Definition at line 144 of file addrman_tests.cpp.

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