Merge pull request #195 from michael-loki/fix_utp_tests

Fix UTPTest test failures
This commit is contained in:
Jeff 2019-01-03 17:06:51 -05:00 committed by GitHub
commit a4751224d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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();