Merge branch 'develop' into develop_update

This commit is contained in:
Robin Müller 2022-11-28 08:36:13 +01:00
commit e86d8c64db
2 changed files with 2 additions and 55 deletions

View File

@ -361,6 +361,8 @@ void DeviceHandlerBase::doStateMachine() {
if ((switchState == PowerSwitchIF::SWITCH_ON) || (switchState == NO_SWITCH)) {
// NOTE: TransitionSourceMode and -SubMode are set by handleCommandedModeTransition
childTransitionFailure = CHILD_TIMEOUT;
transitionSourceMode = _MODE_SHUT_DOWN;
transitionSourceSubMode = SUBMODE_NONE;
setMode(_MODE_START_UP);
callChildStatemachine();
}

View File

@ -1,55 +0,0 @@
#include <array>
#include <catch2/catch_test_macros.hpp>
#include "fsfw/util/dataWrapper.h"
#include "mocks/SimpleSerializable.h"
TEST_CASE("Data Wrapper", "[util]") {
util::DataWrapper wrapper;
SECTION("State") {
REQUIRE(wrapper.isNull());
REQUIRE(wrapper.type == util::DataTypes::NONE);
}
SECTION("Set Raw Data") {
util::DataWrapper* instance = &wrapper;
bool deleteInst = false;
REQUIRE(wrapper.isNull());
std::array<uint8_t, 4> data = {1, 2, 3, 4};
SECTION("Setter") { wrapper.setRawData({data.data(), data.size()}); }
SECTION("Direct Construction Pair") {
instance = new util::DataWrapper(util::BufPair(data.data(), data.size()));
deleteInst = true;
}
SECTION("Direct Construction Single Args") {
instance = new util::DataWrapper(data.data(), data.size());
deleteInst = true;
}
REQUIRE(not instance->isNull());
REQUIRE(instance->type == util::DataTypes::RAW);
REQUIRE(instance->dataUnion.raw.data == data.data());
REQUIRE(instance->dataUnion.raw.len == data.size());
if (deleteInst) {
delete instance;
}
}
SECTION("Simple Serializable") {
util::DataWrapper* instance = &wrapper;
bool deleteInst = false;
REQUIRE(instance->isNull());
SimpleSerializable serializable;
SECTION("Setter") { wrapper.setSerializable(serializable); }
SECTION("Direct Construction") {
instance = new util::DataWrapper(serializable);
deleteInst = true;
}
REQUIRE(not instance->isNull());
REQUIRE(instance->type == util::DataTypes::SERIALIZABLE);
REQUIRE(instance->dataUnion.serializable == &serializable);
if (deleteInst) {
delete instance;
}
}
}