mirror of https://github.com/oxen-io/lokinet
fix unit tests
This commit is contained in:
parent
f4c9e09d44
commit
16c7e7dd33
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue