 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
14 #include <boost/test/unit_test.hpp>
21 const fs::path banlist_path{m_args.GetDataDirBase() /
"banlist_test"};
23 const std::string entries_write{
24 "{ \"banned_nets\": ["
25 " { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"aaaaaaaaa\" },"
26 " { \"version\": 2, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"bbbbbbbbb\" },"
27 " { \"version\": 1, \"ban_created\": 0, \"banned_until\": 778, \"address\": \"1.0.0.0/8\" }"
33 ASSERT_DEBUG_LOG(
"Dropping entry with unparseable address or subnet (aaaaaaaaa) from ban list");
35 BanMan banman{banlist_path,
nullptr, 0};
38 assert(entries_read.size() == 1);
BOOST_AUTO_TEST_CASE(file)
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
#define BOOST_FIXTURE_TEST_SUITE(a, b)
BOOST_AUTO_TEST_SUITE_END()
#define ASSERT_DEBUG_LOG(message)
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
void GetBanned(banmap_t &banmap)
std::map< CSubNet, CBanEntry > banmap_t