restructured test folder and enabled cmake v3 support
This commit is contained in:
5
unittest/tests/serialize/CMakeLists.txt
Normal file
5
unittest/tests/serialize/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
TestSerialBufferAdapter.cpp
|
||||
TestSerialization.cpp
|
||||
TestSerialLinkedPacket.cpp
|
||||
)
|
@ -1,7 +1,9 @@
|
||||
#include "../../serialize/SerialBufferAdapter.h"
|
||||
#include "../../../serialize/SerialBufferAdapter.h"
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "../../core/CatchDefinitions.h"
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <unittest/core/CatchDefinitions.h>
|
||||
|
||||
#include <array>
|
||||
|
||||
|
||||
static bool test_value_bool = true;
|
||||
|
@ -1,9 +1,12 @@
|
||||
#include "TestSerialLinkedPacket.h"
|
||||
#include "../../core/CatchDefinitions.h"
|
||||
#include <unittest/core/CatchDefinitions.h>
|
||||
|
||||
#include "../../globalfunctions/arrayprinter.h"
|
||||
#include "../../../globalfunctions/arrayprinter.h"
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <unittest/core/CatchDefinitions.h>
|
||||
|
||||
#include <array>
|
||||
|
||||
|
||||
TEST_CASE("Serial Linked Packet" , "[SerLinkPacket]") {
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
return buffer.entry.getConstBuffer();
|
||||
}
|
||||
|
||||
const size_t getBufferLength() {
|
||||
size_t getBufferLength() {
|
||||
return buffer.getSerializedSize();
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include "../../serialize/SerializeAdapter.h"
|
||||
#include "../../../serialize/SerializeAdapter.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/catch_approx.hpp>
|
||||
#include <unittest/core/CatchDefinitions.h>
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <array>
|
||||
#include "../../core/CatchDefinitions.h"
|
||||
|
||||
static bool test_value_bool = true;
|
||||
static uint8_t tv_uint8 {5};
|
||||
@ -119,10 +121,10 @@ TEST_CASE("Auto Serialize Adapter testing", "[single-file]") {
|
||||
REQUIRE(tv_int16 == -829);
|
||||
REQUIRE(tv_int32 == -2312);
|
||||
|
||||
REQUIRE(tv_float == Approx(8.214921));
|
||||
REQUIRE(tv_double == Approx(9.2132142141e8));
|
||||
REQUIRE(tv_sfloat == Approx(-922.2321321));
|
||||
REQUIRE(tv_sdouble == Approx(-2.2421e19));
|
||||
REQUIRE(tv_float == Catch::Approx(8.214921));
|
||||
REQUIRE(tv_double == Catch::Approx(9.2132142141e8));
|
||||
REQUIRE(tv_sfloat == Catch::Approx(-922.2321321));
|
||||
REQUIRE(tv_sdouble == Catch::Approx(-2.2421e19));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user