This commit is contained in:
2024-05-28 11:59:56 +03:00
parent d7ed4fac6c
commit 3821d965cc
3 changed files with 54 additions and 3 deletions

26
tests/adc_netmsg_test.cpp Normal file
View File

@@ -0,0 +1,26 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>
#include <iostream>
#include "../net/adc_netmessage.h"
using namespace adc;
TEST_CASE("[ADC NET MESSAGE]")
{
AdcKeyParamNetMessage<> msg;
std::string_view bytes{"SET POS 1 2 3 4 5"};
std::cout << "BYTES: [" << bytes << "]\n";
msg.setFromBytes(bytes.begin(), bytes.end());
std::string key, pars;
msg.key(key);
std::cout << "KEY: [" << key << "]\n";
msg.paramsBytes(pars, 1);
// msg.paramsBytes(pars);
std::cout << "PARS BYTES: [" << pars << "]\n";
}