skeleton controller now unittested including fsfw. Still dirty WIP
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2022-02-10 18:54:09 +01:00
parent f9721eb1ae
commit f1249392cf
6 changed files with 78 additions and 4 deletions

View File

@ -3,4 +3,5 @@ add_subdirectory(controller)
target_sources(${UNITTEST_NAME} PRIVATE
main.cpp
printChar.cpp
)

View File

@ -1,6 +1,38 @@
#include <catch2/catch_test_macros.hpp>
#include <mission/controller/ThermalController.h>
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
/* This is configured for linux without CR */
#ifdef PLATFORM_UNIX
ServiceInterfaceStream sif::debug("DEBUG");
ServiceInterfaceStream sif::info("INFO");
ServiceInterfaceStream sif::warning("WARNING");
ServiceInterfaceStream sif::error("ERROR");
#else
ServiceInterfaceStream sif::debug("DEBUG", true);
ServiceInterfaceStream sif::info("INFO", true);
ServiceInterfaceStream sif::warning("WARNING", true);
ServiceInterfaceStream sif::error("ERROR", true, false, true);
#endif
#include <fsfw/ipc/FwMessageTypes.h>
namespace messagetypes {
enum MESSAGE_TYPE {
MISSION_MESSAGE_TYPE_START = FW_MESSAGES_COUNT,
};
void clearMissionMessage(CommandMessage* message);
} // namespace messagetypes
void messagetypes::clearMissionMessage(CommandMessage* message) {
}
TEST_CASE( "Thermal Controller" , "[ThermalController]") {
bool test = true;

11
unittest/printChar.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "printChar.h"
#include <cstdio>
void printChar(const char* character, bool errStream) {
if (errStream) {
std::putc(*character, stderr);
return;
}
std::putc(*character, stdout);
}

6
unittest/printChar.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef FSFW_UNITTEST_CORE_PRINTCHAR_H_
#define FSFW_UNITTEST_CORE_PRINTCHAR_H_
extern "C" void printChar(const char*, bool errStream);
#endif /* FSFW_UNITTEST_CORE_PRINTCHAR_H_ */