fix unit tests

This commit is contained in:
Jeff Becker 2019-12-19 07:19:47 -05:00 committed by Thomas Winget
parent f4c9e09d44
commit 16c7e7dd33
2 changed files with 4 additions and 22 deletions

View File

@ -53,7 +53,7 @@ namespace llarp
private:
using ID_t = std::thread::id;
llarp_threadpool* const m_Thread;
llarp_ev_loop* m_Loop;
llarp_ev_loop* m_Loop = nullptr;
absl::optional< ID_t > m_ID;
util::ContentionKiller m_Killer;
std::function< void(std::function< void(void) >) > m_Queue;

View File

@ -29,18 +29,6 @@ struct AbyssTestBase : public ::testing::Test
ASSERT_EQ(meth, method);
}
void
CancelIt()
{
Stop();
}
static void
StopIt(void* u)
{
static_cast< AbyssTestBase* >(u)->Stop();
}
void
Start()
{
@ -57,7 +45,7 @@ struct AbyssTestBase : public ::testing::Test
if(server->ServeAsync(loop, logic, a))
{
client->RunAsync(loop, a.ToString());
logic->call_later(1000, std::bind(&AbyssTestBase::CancelIt, this));
logic->call_later(1000, std::bind(&AbyssTestBase::Stop, this));
return;
}
std::this_thread::sleep_for(std::chrono::seconds(1));
@ -74,7 +62,7 @@ struct AbyssTestBase : public ::testing::Test
void
AsyncStop()
{
logic->queue_job({this, &StopIt});
LogicCall(logic, std::bind(&AbyssTestBase::Stop, this));
}
~AbyssTestBase()
@ -157,16 +145,10 @@ struct AbyssTest : public AbyssTestBase,
return new ServerHandler(impl, this);
}
static void
FlushIt(void* u)
{
static_cast< AbyssTest* >(u)->Flush();
}
void
AsyncFlush()
{
logic->queue_job({this, &FlushIt});
LogicCall(logic, std::bind(&AbyssTest::Flush, this));
}
void