mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-19 09:25:28 +00:00
Merge pull request #195 from michael-loki/fix_utp_tests
Fix UTPTest test failures
This commit is contained in:
commit
a4751224d9
@ -116,7 +116,7 @@ if(NOT DEBIAN)
|
||||
endif(NOT DEBIAN)
|
||||
|
||||
if(ASAN)
|
||||
set(DEBUG_FLAGS ${DEBUG_FLAGS} -fsanitize=address -fno-omit-frame-pointer)
|
||||
set(DEBUG_FLAGS ${DEBUG_FLAGS} -fsanitize=thread -fno-omit-frame-pointer)
|
||||
set(OPTIMIZE_FLAGS "-O0")
|
||||
endif(ASAN)
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace llarp
|
||||
}
|
||||
|
||||
uint32_t
|
||||
Logic::call_later(struct llarp_timeout_job job)
|
||||
Logic::call_later(const llarp_timeout_job& job)
|
||||
{
|
||||
llarp_timeout_job j;
|
||||
j.user = job.user;
|
||||
|
@ -44,7 +44,7 @@ namespace llarp
|
||||
queue_job(struct llarp_thread_job job);
|
||||
|
||||
uint32_t
|
||||
call_later(struct llarp_timeout_job job);
|
||||
call_later(const llarp_timeout_job& job);
|
||||
|
||||
void
|
||||
cancel_call(uint32_t id);
|
||||
|
@ -102,30 +102,25 @@ struct UTPTest : public ::testing::Test
|
||||
bool success = false;
|
||||
|
||||
llarp_ev_loop* netLoop;
|
||||
std::unique_ptr< llarp::Logic > logic;
|
||||
|
||||
llarp_time_t oldRCLifetime;
|
||||
|
||||
std::unique_ptr< llarp::Logic > logic;
|
||||
|
||||
UTPTest()
|
||||
: crypto(llarp::Crypto::sodium{})
|
||||
, Alice(crypto)
|
||||
, Bob(crypto)
|
||||
, netLoop(nullptr)
|
||||
, oldRCLifetime(llarp::RouterContact::Lifetime)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
SetUp()
|
||||
{
|
||||
oldRCLifetime = llarp::RouterContact::Lifetime;
|
||||
llarp::RouterContact::IgnoreBogons = true;
|
||||
llarp::RouterContact::Lifetime = 500;
|
||||
llarp_ev_loop_alloc(&netLoop);
|
||||
logic.reset(new llarp::Logic());
|
||||
}
|
||||
|
||||
void
|
||||
TearDown()
|
||||
~UTPTest()
|
||||
{
|
||||
Alice.TearDown();
|
||||
Bob.TearDown();
|
||||
|
Loading…
Reference in New Issue
Block a user