lokinet/test/llarp_test.hpp

31 lines
515 B
C++
Raw Normal View History

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