Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/test/p2p_messaging_tests.cpp
// Copyright (c) 2019 The Bitcoin developers | // Copyright (c) 2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#define BOOST_TEST_MODULE Bitcoin Seeder Test Suite | #define BOOST_TEST_MODULE Bitcoin Seeder Test Suite | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <protocol.h> | #include <protocol.h> | ||||
#include <seeder/bitcoin.h> | #include <seeder/bitcoin.h> | ||||
#include <seeder/db.h> | #include <seeder/db.h> | ||||
#include <seeder/test/util.h> | |||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <version.h> | #include <version.h> | ||||
#include <memory> | #include <memory> | ||||
#include <ostream> | |||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
std::ostream &operator<<(std::ostream &os, const PeerMessagingState &state) { | |||||
os << to_integral(state); | |||||
return os; | |||||
} | |||||
class TestCSeederNode : public CSeederNode { | class TestCSeederNode : public CSeederNode { | ||||
public: | public: | ||||
TestCSeederNode(const CService &service, std::vector<CAddress> *vAddrIn) | TestCSeederNode(const CService &service, std::vector<CAddress> *vAddrIn) | ||||
: CSeederNode(service, vAddrIn) { | : CSeederNode(service, vAddrIn) { | ||||
SelectParams(CBaseChainParams::REGTEST); | SelectParams(CBaseChainParams::REGTEST); | ||||
} | } | ||||
void TestProcessMessage(const std::string &strCommand, CDataStream &message, | void TestProcessMessage(const std::string &strCommand, CDataStream &message, | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |