lokinet/test/routing/test_llarp_routing_transfer_traffic.cpp

25 lines
596 B
C++
Raw Normal View History

2023-01-09 17:47:41 +00:00
#include <llarp/routing/transfer_traffic_message.hpp>
2021-03-01 21:07:32 +00:00
#include <catch2/catch.hpp>
using TransferTrafficMessage = llarp::routing::TransferTrafficMessage;
TEST_CASE("TransferTrafficMessage", "[TransferTrafficMessage]")
{
TransferTrafficMessage msg;
SECTION("Put buffer overflow")
{
std::array<byte_t, llarp::routing::MaxExitMTU* 2> tmp = {{0}};
llarp_buffer_t buf(tmp);
REQUIRE_FALSE(msg.PutBuffer(buf, 1));
}
SECTION("Put buffer")
{
std::array<byte_t, llarp::routing::MaxExitMTU> tmp = {{0}};
llarp_buffer_t buf(tmp);
REQUIRE(msg.PutBuffer(buf, 1));
}
}