mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-03 23:15:52 +00:00
25 lines
648 B
C++
25 lines
648 B
C++
|
#include <gtest/gtest.h>
|
||
|
#include <llarp/messages/transfer_traffic.hpp>
|
||
|
|
||
|
using TransferTrafficMessage = llarp::routing::TransferTrafficMessage;
|
||
|
|
||
|
class TransferTrafficTest : public ::testing::Test
|
||
|
{
|
||
|
};
|
||
|
|
||
|
TEST_F(TransferTrafficTest, TestPutBufferOverflow)
|
||
|
{
|
||
|
TransferTrafficMessage msg;
|
||
|
byte_t tmp[llarp::routing::MaxExitMTU * 2] = {0};
|
||
|
auto buf = llarp::StackBuffer< decltype(tmp) >(tmp);
|
||
|
ASSERT_FALSE(msg.PutBuffer(buf));
|
||
|
};
|
||
|
|
||
|
TEST_F(TransferTrafficTest, TestPutBuffer)
|
||
|
{
|
||
|
TransferTrafficMessage msg;
|
||
|
byte_t tmp[llarp::routing::MaxExitMTU] = {0};
|
||
|
auto buf = llarp::StackBuffer< decltype(tmp) >(tmp);
|
||
|
ASSERT_TRUE(msg.PutBuffer(buf));
|
||
|
};
|