mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
6 years ago
|
#ifndef TEST_LLARP_MOCK_CONTEXT
|
||
|
#define TEST_LLARP_MOCK_CONTEXT
|
||
|
|
||
|
#include <dht/context.hpp>
|
||
|
|
||
|
#include <gmock/gmock.h>
|
||
|
|
||
|
namespace llarp
|
||
|
{
|
||
|
namespace test
|
||
|
{
|
||
|
struct MockContext final : public dht::AbstractContext
|
||
|
{
|
||
|
MOCK_METHOD2(LookupRouter, bool(const RouterID&, RouterLookupHandler));
|
||
|
|
||
|
MOCK_METHOD6(LookupIntroSetRecursive,
|
||
|
void(const service::Address&, const dht::Key_t&, uint64_t,
|
||
|
const dht::Key_t&, uint64_t,
|
||
|
service::IntroSetLookupHandler));
|
||
|
|
||
|
MOCK_METHOD5(LookupIntroSetIterative,
|
||
|
void(const service::Address&, const dht::Key_t&, uint64_t,
|
||
|
const dht::Key_t&, service::IntroSetLookupHandler));
|
||
|
|
||
|
MOCK_METHOD3(
|
||
|
FindRandomIntroSetsWithTagExcluding,
|
||
|
std::set< service::IntroSet >(const service::Tag&, size_t,
|
||
|
const std::set< service::IntroSet >&));
|
||
|
|
||
|
MOCK_METHOD3(DHTSendTo, void(const RouterID&, dht::IMessage*, bool));
|
||
|
|
||
|
MOCK_CONST_METHOD0(Now, llarp_time_t());
|
||
|
|
||
|
MOCK_CONST_METHOD0(Crypto, llarp::Crypto*());
|
||
|
|
||
|
MOCK_CONST_METHOD0(GetRouter, llarp::Router*());
|
||
|
|
||
|
MOCK_CONST_METHOD0(OurKey, const dht::Key_t&());
|
||
|
|
||
|
MOCK_CONST_METHOD0(Nodes, dht::Bucket< dht::RCNode >*());
|
||
|
};
|
||
|
|
||
|
} // namespace test
|
||
|
} // namespace llarp
|
||
|
|
||
|
#endif
|