mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
36 lines
663 B
C++
36 lines
663 B
C++
#ifndef LLARP_TEST
|
|
#define LLARP_TEST
|
|
|
|
#include <crypto/mock_crypto.hpp>
|
|
#include <catch2/catch.hpp>
|
|
#include <gmock/gmock.h>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace test
|
|
{
|
|
template <typename CryptoImpl = MockCrypto>
|
|
class LlarpTest
|
|
{
|
|
protected:
|
|
CryptoImpl m_crypto;
|
|
CryptoManager cm;
|
|
|
|
LlarpTest() : cm(&m_crypto)
|
|
{
|
|
static_assert(std::is_base_of<Crypto, CryptoImpl>::value, "");
|
|
}
|
|
|
|
~LlarpTest()
|
|
{}
|
|
};
|
|
|
|
template <>
|
|
inline LlarpTest<MockCrypto>::~LlarpTest()
|
|
{
|
|
CHECK(::testing::Mock::VerifyAndClearExpectations(&m_crypto));
|
|
}
|
|
} // namespace test
|
|
} // namespace llarp
|
|
|
|
#endif
|