1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/test/llarp_test.hpp

37 lines
663 B
C++
Raw Normal View History

2019-05-28 21:45:09 +02:00
#ifndef LLARP_TEST
#define LLARP_TEST
#include <crypto/mock_crypto.hpp>
2021-03-01 22:07:32 +01:00
#include <catch2/catch.hpp>
#include <gmock/gmock.h>
2019-05-28 21:45:09 +02:00
namespace llarp
{
namespace test
{
2021-03-01 22:07:32 +01:00
template <typename CryptoImpl = MockCrypto>
class LlarpTest
2019-05-28 21:45:09 +02:00
{
protected:
CryptoImpl m_crypto;
CryptoManager cm;
LlarpTest() : cm(&m_crypto)
{
2021-03-01 22:07:32 +01:00
static_assert(std::is_base_of<Crypto, CryptoImpl>::value, "");
2019-05-28 21:45:09 +02:00
}
2021-03-01 22:07:32 +01:00
~LlarpTest()
{}
2019-05-28 21:45:09 +02:00
};
2021-03-01 22:07:32 +01:00
template <>
inline LlarpTest<MockCrypto>::~LlarpTest()
{
CHECK(::testing::Mock::VerifyAndClearExpectations(&m_crypto));
}
2019-05-28 21:45:09 +02:00
} // namespace test
} // namespace llarp
#endif