1
0
forked from fsfw/fsfw

added catch framework for basic testing

This commit is contained in:
2020-04-14 16:19:13 +02:00
parent c5e5de1530
commit af27a2441a
10 changed files with 18401 additions and 3 deletions

View File

@ -11,6 +11,15 @@
#include <cstdlib>
#if defined(UNIT_TEST)
#include "catch.hpp"
#define CATCH_CONFIG_MAIN
TEST_CASE( "Serialization Size tests", "[single-file]") {
//REQUIRE(UnitTestClass::test_serialization == RETURN_OK );
}
#endif
UnitTestClass::UnitTestClass() {}
UnitTestClass::~UnitTestClass() {}
@ -53,6 +62,7 @@ ReturnValue_t UnitTestClass::test_endianness_tools() {
return put_error(TestIds::ENDIANNESS_TOOLS);
}
p_array = test_array.data();
size = 0;
AutoSerializeAdapter::serialize(&two_byte_value, &p_array, &size, 2, true);
@ -180,6 +190,7 @@ ReturnValue_t UnitTestClass::test_autoserialization() {
return put_error(current_id);
}
// These epsilon values were just guessed.. It appears to work though.
if(abs(tv_float - 8.214921) > 0.0001 or
abs(tv_double - 9.2132142141e8) > 0.01 or
abs(tv_sfloat - (-922.2321321)) > 0.0001 or