6#include <chainparams.h>
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};
BOOST_AUTO_TEST_CASE(file)
void GetBanned(banmap_t &banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
std::map< CSubNet, CBanEntry > banmap_t
#define BOOST_CHECK_EQUAL(v1, v2)
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
#define ASSERT_DEBUG_LOG(message)
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.