From d9a0a80365e277858ff5fa35dcc33c7347d348c4 Mon Sep 17 00:00:00 2001 From: Pavel Vaynerman Date: Fri, 9 Jul 2021 00:56:33 +0300 Subject: [PATCH] [unet-protobuf]: added perf-test --- extensions/UNetUDP/tests/test_unet_proto.cc | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/extensions/UNetUDP/tests/test_unet_proto.cc b/extensions/UNetUDP/tests/test_unet_proto.cc index 5d6847b4a..8f37a1a87 100644 --- a/extensions/UNetUDP/tests/test_unet_proto.cc +++ b/extensions/UNetUDP/tests/test_unet_proto.cc @@ -3,6 +3,7 @@ #include #include "UniSetTypes.h" #include "UDPPacket.h" +#include "PassiveTimer.h" // ----------------------------------------------------------------------------- #include "proto/unet.pb.h" // ----------------------------------------------------------------------------- @@ -113,3 +114,35 @@ TEST_CASE("[UNetUDP]: crc", "[unetudp][protobuf][crc]") REQUIRE( pack.dataCRC() != crc ); REQUIRE( pack.dataCRCWithBuf(buf, sizeof(buf)) != crc_b ); } + +// ----------------------------------------------------------------------------- +TEST_CASE("[UNetUDP]: perf test", "[unetudp][protobuf][perf]") +{ + uint8_t buf[uniset::UniSetUDP::MessageBufSize]; + + UniSetUDP::UDPMessage pack; + REQUIRE(pack.isOk()); + pack.setNodeID(100); + pack.setProcID(100); + pack.setNum(1); + + for( size_t i=0; i