1
0
forked from fsfw/fsfw

Merge branch 'mueller/refactor-tmtc-stack' into mueller/cfdp-routers

This commit is contained in:
2022-08-15 19:07:22 +02:00
13 changed files with 47 additions and 191 deletions

View File

@ -1,2 +1,3 @@
target_sources(${FSFW_TEST_TGT} PRIVATE testUnsignedByteField.cpp
testObjectId.cpp)
target_sources(${FSFW_TEST_TGT} PRIVATE
testUnsignedByteField.cpp
)

View File

@ -1,26 +0,0 @@
#include <array>
#include <catch2/catch_test_macros.hpp>
#include "fsfw/util/ObjectId.h"
TEST_CASE("Object Id", "[object-id]") {
auto objectId = ObjectId(10, "TEST_ID");
std::map<ObjectId, int> testMap;
SECTION("State") {
CHECK(objectId.id() == 10);
CHECK(std::strcmp(objectId.name(), "TEST_ID") == 0);
}
SECTION("ID as map key") {
auto insertPair = testMap.emplace(objectId, 10);
CHECK(insertPair.second);
auto iter = testMap.find(objectId);
CHECK(iter != testMap.end());
CHECK(std::strcmp(iter->first.name(), "TEST_ID") == 0);
CHECK(iter->second == 10);
auto otherIdSameName = ObjectId(12, "TEST_ID");
insertPair = testMap.emplace(otherIdSameName, 10);
CHECK(insertPair.second);
}
}