1
0
forked from fsfw/fsfw

restructured test folder and enabled cmake v3 support

This commit is contained in:
2020-12-27 14:14:38 +01:00
parent 426514b9a2
commit 37463b660b
58 changed files with 132 additions and 57 deletions

View File

@ -0,0 +1,5 @@
target_sources(${TARGET_NAME} PRIVATE
TestSerialBufferAdapter.cpp
TestSerialization.cpp
TestSerialLinkedPacket.cpp
)

View File

@ -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;

View File

@ -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]") {

View File

@ -37,7 +37,7 @@ public:
return buffer.entry.getConstBuffer();
}
const size_t getBufferLength() {
size_t getBufferLength() {
return buffer.getSerializedSize();
}

View File

@ -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));
}
}