Bitcoin Core  24.99.0
P2P Digital Currency
Functions | Variables
addrman_tests.cpp File Reference
#include <addrdb.h>
#include <addrman.h>
#include <addrman_impl.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.

Functions

static int32_t GetCheckRatio (const NodeContext &node_ctx)
 
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_new_multiplicity)
 
 BOOST_AUTO_TEST_CASE (addrman_tried_collisions)
 
 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)
 
static CDataStream AddrmanToStream (const AddrMan &addrman)
 
 BOOST_AUTO_TEST_CASE (load_addrman)
 
static CDataStream MakeCorruptPeersDat ()
 
 BOOST_AUTO_TEST_CASE (load_addrman_corrupted)
 
 BOOST_AUTO_TEST_CASE (addrman_update_address)
 
 BOOST_AUTO_TEST_CASE (addrman_size)
 

Variables

static NetGroupManager EMPTY_NETGROUPMAN {std::vector<bool>()}
 
static const bool DETERMINISTIC {true}
 

Function Documentation

◆ AddrmanToStream()

static CDataStream AddrmanToStream ( const AddrMan addrman)
static

Definition at line 857 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_evictionworks  )

Definition at line 795 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/20]

BOOST_AUTO_TEST_CASE ( addrman_getaddr  )

Definition at line 287 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/20]

BOOST_AUTO_TEST_CASE ( addrman_new_collisions  )

Definition at line 195 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/20]

BOOST_AUTO_TEST_CASE ( addrman_new_multiplicity  )

Definition at line 224 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/20]

BOOST_AUTO_TEST_CASE ( addrman_noevict  )

Definition at line 743 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/20]

BOOST_AUTO_TEST_CASE ( addrman_ports  )

Definition at line 107 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/20]

BOOST_AUTO_TEST_CASE ( addrman_select  )

Definition at line 136 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/20]

BOOST_AUTO_TEST_CASE ( addrman_selecttriedcollision  )

Definition at line 710 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/20]

BOOST_AUTO_TEST_CASE ( addrman_serialization  )

Definition at line 604 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/20]

BOOST_AUTO_TEST_CASE ( addrman_simple  )

Definition at line 63 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/20]

BOOST_AUTO_TEST_CASE ( addrman_size  )

Definition at line 991 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/20]

BOOST_AUTO_TEST_CASE ( addrman_tried_collisions  )

Definition at line 256 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/20]

BOOST_AUTO_TEST_CASE ( addrman_update_address  )

Definition at line 960 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 526 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 398 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 472 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 347 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 865 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 936 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 669 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 49 of file addrman_tests.cpp.

Here is the caller graph for this function:

◆ GetCheckRatio()

static int32_t GetCheckRatio ( const NodeContext node_ctx)
static

Definition at line 29 of file addrman_tests.cpp.

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

◆ MakeCorruptPeersDat()

static CDataStream MakeCorruptPeersDat ( )
static

Definition at line 910 of file addrman_tests.cpp.

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

◆ ResolveIP()

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

Definition at line 34 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 41 of file addrman_tests.cpp.

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

Variable Documentation

◆ DETERMINISTIC

const bool DETERMINISTIC {true}
static

Definition at line 27 of file addrman_tests.cpp.

◆ EMPTY_NETGROUPMAN

NetGroupManager EMPTY_NETGROUPMAN {std::vector<bool>()}
static

Definition at line 26 of file addrman_tests.cpp.