|
|
|
@ -13,7 +13,7 @@ using TestPipeReadFunc = std::function< bool(const llarp_buffer_t) >;
|
|
|
|
|
struct EventLoopTest : public ::testing::Test
|
|
|
|
|
{
|
|
|
|
|
llarp_ev_loop_ptr loop;
|
|
|
|
|
std::shared_ptr<llarp::Logic> _logic;
|
|
|
|
|
std::shared_ptr< llarp::Logic > _logic;
|
|
|
|
|
llarp::sodium::CryptoLibSodium crypto;
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
@ -27,8 +27,8 @@ struct EventLoopTest : public ::testing::Test
|
|
|
|
|
void
|
|
|
|
|
SetUp()
|
|
|
|
|
{
|
|
|
|
|
loop = llarp_make_ev_loop();
|
|
|
|
|
_logic = std::make_shared<llarp::Logic>();
|
|
|
|
|
loop = llarp_make_ev_loop();
|
|
|
|
|
_logic = std::make_shared< llarp::Logic >();
|
|
|
|
|
_logic->call_later({10000, this, &OnTimeout});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,6 +62,7 @@ struct EventLoopTest : public ::testing::Test
|
|
|
|
|
|
|
|
|
|
TEST_F(EventLoopTest, PipeWriteOne)
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
llarp::AlignedBuffer< 32 > data;
|
|
|
|
|
data.Randomize();
|
|
|
|
|
llarp_buffer_t other(data);
|
|
|
|
@ -89,10 +90,14 @@ TEST_F(EventLoopTest, PipeWriteOne)
|
|
|
|
|
ASSERT_TRUE(loop->add_ev(testpipe, false));
|
|
|
|
|
ASSERT_TRUE(testpipe->Write(other));
|
|
|
|
|
RunLoop();
|
|
|
|
|
#else
|
|
|
|
|
SUCCEED();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(EventLoopTest, PipeWrite1K)
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
struct TestPipe : public llarp_ev_pkt_pipe
|
|
|
|
|
{
|
|
|
|
|
using Data_t = std::vector< llarp::AlignedBuffer< 1500 > >;
|
|
|
|
@ -133,4 +138,7 @@ TEST_F(EventLoopTest, PipeWrite1K)
|
|
|
|
|
ASSERT_TRUE(loop->add_ev(testpipe, false));
|
|
|
|
|
testpipe->PumpIt();
|
|
|
|
|
RunLoop();
|
|
|
|
|
#else
|
|
|
|
|
SUCCEED();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|