Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
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 <netgroup.h>
#include <random.h>
#include <test/data/asmap.raw.h>
#include <test/util/common.h>
#include <test/util/setup_common.h>
#include <test/util/time.h>
#include <util/asmap.h>
#include <util/string.h>
#include <boost/test/unit_test.hpp>
#include <cstdint>
#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)
 BOOST_AUTO_TEST_CASE (addrman_simple)
 BOOST_AUTO_TEST_CASE (addrman_terrible_many_failures)
 BOOST_AUTO_TEST_CASE (addrman_penalty_self_announcement)
 BOOST_AUTO_TEST_CASE (addrman_ports)
 BOOST_AUTO_TEST_CASE (addrman_select)
 BOOST_AUTO_TEST_CASE (addrman_select_by_network)
 BOOST_AUTO_TEST_CASE (addrman_select_special)
 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 (getaddr_unfiltered)
 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 auto AddrmanToStream (const AddrMan &addrman)
 BOOST_AUTO_TEST_CASE (load_addrman)
static auto MakeCorruptPeersDat ()
 BOOST_AUTO_TEST_CASE (load_addrman_corrupted)
 BOOST_AUTO_TEST_CASE (addrman_update_address)
 BOOST_AUTO_TEST_CASE (addrman_size)
template<typename T>
std::string ToString (const T &t)
 Locale-independent version of std::to_string.

Variables

static auto EMPTY_NETGROUPMAN {NetGroupManager::NoAsmap()}
static const bool DETERMINISTIC {true}

Function Documentation

◆ AddrmanToStream()

auto AddrmanToStream ( const AddrMan & addrman)
static

Definition at line 1046 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/25]

BOOST_AUTO_TEST_CASE ( addrman_evictionworks )

Definition at line 983 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/25]

BOOST_AUTO_TEST_CASE ( addrman_getaddr )

Definition at line 443 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/25]

BOOST_AUTO_TEST_CASE ( addrman_new_collisions )

Definition at line 351 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/25]

BOOST_AUTO_TEST_CASE ( addrman_new_multiplicity )

Definition at line 380 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/25]

BOOST_AUTO_TEST_CASE ( addrman_noevict )

Definition at line 931 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/25]

BOOST_AUTO_TEST_CASE ( addrman_penalty_self_announcement )

Definition at line 134 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/25]

BOOST_AUTO_TEST_CASE ( addrman_ports )

Definition at line 173 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/25]

BOOST_AUTO_TEST_CASE ( addrman_select )

Definition at line 201 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/25]

BOOST_AUTO_TEST_CASE ( addrman_select_by_network )

Definition at line 260 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/25]

BOOST_AUTO_TEST_CASE ( addrman_select_special )

Definition at line 328 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/25]

BOOST_AUTO_TEST_CASE ( addrman_selecttriedcollision )

Definition at line 898 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/25]

BOOST_AUTO_TEST_CASE ( addrman_serialization )

Definition at line 793 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/25]

BOOST_AUTO_TEST_CASE ( addrman_simple )

Definition at line 55 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/25]

BOOST_AUTO_TEST_CASE ( addrman_size )

Definition at line 1203 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/25]

BOOST_AUTO_TEST_CASE ( addrman_terrible_many_failures )

Definition at line 100 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/25]

BOOST_AUTO_TEST_CASE ( addrman_tried_collisions )

Definition at line 412 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/25]

BOOST_AUTO_TEST_CASE ( addrman_update_address )

Definition at line 1146 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/25]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_new_bucket )

Definition at line 716 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [19/25]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_new_bucket_legacy )

Definition at line 589 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [20/25]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_tried_bucket )

Definition at line 663 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [21/25]

BOOST_AUTO_TEST_CASE ( caddrinfo_get_tried_bucket_legacy )

Definition at line 538 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [22/25]

BOOST_AUTO_TEST_CASE ( getaddr_unfiltered )

Definition at line 502 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [23/25]

BOOST_AUTO_TEST_CASE ( load_addrman )

Definition at line 1054 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [24/25]

BOOST_AUTO_TEST_CASE ( load_addrman_corrupted )

Definition at line 1125 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [25/25]

BOOST_AUTO_TEST_CASE ( remove_invalid )

Definition at line 857 of file addrman_tests.cpp.

Here is the call graph for this function:

◆ GetCheckRatio()

int32_t GetCheckRatio ( const NodeContext & node_ctx)
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:

◆ MakeCorruptPeersDat()

auto MakeCorruptPeersDat ( )
static

Definition at line 1099 of file addrman_tests.cpp.

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

◆ ResolveIP()

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

Definition at line 39 of file addrman_tests.cpp.

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

◆ ResolveService()

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

Definition at line 46 of file addrman_tests.cpp.

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

◆ ToString()

template<typename T>
std::string util::ToString ( const T & t)

Locale-independent version of std::to_string.

Definition at line 250 of file string.h.

Variable Documentation

◆ DETERMINISTIC

const bool DETERMINISTIC {true}
static

Definition at line 32 of file addrman_tests.cpp.

◆ EMPTY_NETGROUPMAN

auto EMPTY_NETGROUPMAN {NetGroupManager::NoAsmap()}
static

Definition at line 31 of file addrman_tests.cpp.