make it compile

This commit is contained in:
Jeff Becker 2018-12-20 12:14:21 -05:00
parent d14dcaa895
commit 259283f3c4
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -6,7 +6,7 @@
struct AbyssTestBase : public ::testing::Test struct AbyssTestBase : public ::testing::Test
{ {
llarp::Crypto crypto; llarp::Crypto crypto;
llarp_threadpool* threadpool = nullptr; llarp_threadpool* threadpool = nullptr;
llarp_ev_loop* loop = nullptr; llarp_ev_loop* loop = nullptr;
llarp::Logic* logic = nullptr; llarp::Logic* logic = nullptr;
@ -15,6 +15,10 @@ struct AbyssTestBase : public ::testing::Test
const std::string method = "test.method"; const std::string method = "test.method";
bool called = false; bool called = false;
AbyssTestBase() : crypto(llarp::Crypto::sodium{})
{
}
void void
AssertMethod(const std::string& meth) const AssertMethod(const std::string& meth) const
{ {
@ -25,7 +29,6 @@ struct AbyssTestBase : public ::testing::Test
SetUp() SetUp()
{ {
// for llarp::randint // for llarp::randint
llarp_crypto_init(&crypto);
} }
static void static void
@ -41,7 +44,7 @@ struct AbyssTestBase : public ::testing::Test
{ {
threadpool = llarp_init_same_process_threadpool(); threadpool = llarp_init_same_process_threadpool();
llarp_ev_loop_alloc(&loop); llarp_ev_loop_alloc(&loop);
logic = llarp_init_single_process_logic(threadpool); logic = new llarp::Logic(threadpool);
sockaddr_in addr; sockaddr_in addr;
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@ -75,7 +78,8 @@ struct AbyssTestBase : public ::testing::Test
{ {
if(loop && threadpool && logic) if(loop && threadpool && logic)
{ {
llarp_free_logic(&logic); delete logic;
logic = nullptr;
llarp_ev_loop_free(&loop); llarp_ev_loop_free(&loop);
llarp_free_threadpool(&threadpool); llarp_free_threadpool(&threadpool);
} }