lokinet/test/llarp_test.hpp

31 lines
509 B
C++
Raw Normal View History

2021-03-03 13:33:20 +00:00
#pragma once
2019-05-28 19:45:09 +00:00
2021-03-03 13:33:20 +00:00
#include <crypto/crypto_libsodium.hpp>
2021-03-01 21:07:32 +00:00
#include <catch2/catch.hpp>
2019-05-28 19:45:09 +00:00
2021-03-03 13:33:20 +00:00
namespace llarp::test
2019-05-28 19:45:09 +00:00
{
2021-03-03 13:33:20 +00:00
template <typename CryptoImpl = llarp::sodium::CryptoLibSodium>
class LlarpTest
2019-05-28 19:45:09 +00:00
{
2021-03-03 13:33:20 +00:00
protected:
CryptoImpl m_crypto;
CryptoManager cm;
LlarpTest() : cm(&m_crypto)
2019-05-28 19:45:09 +00:00
{
2021-03-03 13:33:20 +00:00
static_assert(std::is_base_of<Crypto, CryptoImpl>::value, "");
}
2019-05-28 19:45:09 +00:00
2021-03-03 13:33:20 +00:00
~LlarpTest()
{}
};
2021-03-01 21:07:32 +00:00
2021-03-03 13:33:20 +00:00
template <>
inline LlarpTest<llarp::sodium::CryptoLibSodium>::~LlarpTest()
{
2021-03-01 21:07:32 +00:00
2019-05-28 19:45:09 +00:00
} // namespace test
2021-03-03 13:33:20 +00:00
}