From 259283f3c4755bc18f558cc040178309964d84db Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 20 Dec 2018 12:14:21 -0500 Subject: [PATCH] make it compile --- test/jsonrpc_unittest.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/jsonrpc_unittest.cpp b/test/jsonrpc_unittest.cpp index 260c106cf..3fa55034d 100644 --- a/test/jsonrpc_unittest.cpp +++ b/test/jsonrpc_unittest.cpp @@ -6,7 +6,7 @@ struct AbyssTestBase : public ::testing::Test { - llarp::Crypto crypto; + llarp::Crypto crypto; llarp_threadpool* threadpool = nullptr; llarp_ev_loop* loop = nullptr; llarp::Logic* logic = nullptr; @@ -15,6 +15,10 @@ struct AbyssTestBase : public ::testing::Test const std::string method = "test.method"; bool called = false; + AbyssTestBase() : crypto(llarp::Crypto::sodium{}) + { + } + void AssertMethod(const std::string& meth) const { @@ -25,7 +29,6 @@ struct AbyssTestBase : public ::testing::Test SetUp() { // for llarp::randint - llarp_crypto_init(&crypto); } static void @@ -41,7 +44,7 @@ struct AbyssTestBase : public ::testing::Test { threadpool = llarp_init_same_process_threadpool(); llarp_ev_loop_alloc(&loop); - logic = llarp_init_single_process_logic(threadpool); + logic = new llarp::Logic(threadpool); sockaddr_in addr; addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); @@ -75,7 +78,8 @@ struct AbyssTestBase : public ::testing::Test { if(loop && threadpool && logic) { - llarp_free_logic(&logic); + delete logic; + logic = nullptr; llarp_ev_loop_free(&loop); llarp_free_threadpool(&threadpool); }