run auto-formatter
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2022-07-14 17:35:49 +02:00
parent 2c3c05e2d4
commit 3ca11b5894
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
11 changed files with 268 additions and 269 deletions

View File

@ -1,5 +1,4 @@
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp) target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
add_subdirectory(fsfwconfig) add_subdirectory(fsfwconfig)
add_subdirectory(boardconfig) add_subdirectory(boardconfig)

View File

@ -173,8 +173,6 @@ void initmission::initTasks() {
} }
#endif /* OBSW_ADD_TEST_CODE == 1 */ #endif /* OBSW_ADD_TEST_CODE == 1 */
sif::info << "Starting tasks.." << std::endl; sif::info << "Starting tasks.." << std::endl;
tmTcDistributor->startTask(); tmTcDistributor->startTask();
tmtcBridgeTask->startTask(); tmtcBridgeTask->startTask();

View File

@ -26,7 +26,6 @@
#include <test/testtasks/TestTask.h> #include <test/testtasks/TestTask.h>
#endif #endif
#include "mission/utility/GlobalConfigHandler.h"
#include <dummies/AcuDummy.h> #include <dummies/AcuDummy.h>
#include <dummies/BpxDummy.h> #include <dummies/BpxDummy.h>
#include <dummies/ComCookieDummy.h> #include <dummies/ComCookieDummy.h>
@ -45,6 +44,8 @@
#include <dummies/SyrlinksDummy.h> #include <dummies/SyrlinksDummy.h>
#include <dummies/TemperatureSensorsDummy.h> #include <dummies/TemperatureSensorsDummy.h>
#include "mission/utility/GlobalConfigHandler.h"
void Factory::setStaticFrameworkObjectIds() { void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
PusServiceBase::packetDestination = objects::TM_FUNNEL; PusServiceBase::packetDestination = objects::TM_FUNNEL;
@ -90,6 +91,4 @@ void ObjectFactory::produce(void* args) {
new SusDummy(); new SusDummy();
new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT);
new TestTask(objects::TEST_TASK); new TestTask(objects::TEST_TASK);
} }

View File

@ -31,7 +31,9 @@ int main(void) {
<< "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --" << "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
<< std::endl; << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
std::cout << "-- " <<" BSP HOSTED"<< " --" << std::endl; std::cout << "-- "
<< " BSP HOSTED"
<< " --" << std::endl;
initmission::initMission(); initmission::initMission();

View File

@ -1,5 +1,2 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp
CCSDSHandler.cpp TmFunnel.cpp)
VirtualChannel.cpp
TmFunnel.cpp
)

View File

@ -1,2 +1,3 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE TmFunnel.cpp Timestamp.cpp target_sources(
ProgressPrinter.cpp Filenaming.cpp GlobalConfigHandler.cpp) ${LIB_EIVE_MISSION} PRIVATE TmFunnel.cpp Timestamp.cpp ProgressPrinter.cpp
Filenaming.cpp GlobalConfigHandler.cpp)

View File

@ -8,7 +8,6 @@
#ifndef MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_ #ifndef MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_
#define MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_ #define MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_
static constexpr double PARAM0_DEFAULT = 5.0; static constexpr double PARAM0_DEFAULT = 5.0;
static constexpr int PARAM1_DEFAULT = 905; static constexpr int PARAM1_DEFAULT = 905;
@ -18,6 +17,4 @@ enum ParamIds : uint8_t {
PARAM2 = 2, PARAM2 = 2,
}; };
#endif /* MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_ */ #endif /* MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_ */

View File

@ -6,38 +6,37 @@
*/ */
#include "GlobalConfigHandler.h" #include "GlobalConfigHandler.h"
#include <fsfw/ipc/MutexFactory.h>
#include "fsfw/serviceinterface/ServiceInterface.h"
#include <fsfw/ipc/MessageQueueIF.h> #include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/ipc/MutexFactory.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include "fsfw/serviceinterface/ServiceInterface.h"
MutexIF* GlobalConfigHandler::configLock = nullptr; MutexIF* GlobalConfigHandler::configLock = nullptr;
GlobalConfigHandler::GlobalConfigHandler(object_id_t objectId, std::string configFilePath): GlobalConfigHandler::GlobalConfigHandler(object_id_t objectId, std::string configFilePath)
SystemObject(objectId), : SystemObject(objectId),
NVMParameterBase(configFilePath), NVMParameterBase(configFilePath),
commandQueue(QueueFactory::instance()->createMessageQueue(20)) commandQueue(QueueFactory::instance()->createMessageQueue(20)) {
{
if (configLock == nullptr) { if (configLock == nullptr) {
configLock = MutexFactory::instance()->createMutex(); configLock = MutexFactory::instance()->createMutex();
} }
} }
ReturnValue_t GlobalConfigHandler::initialize() { ReturnValue_t GlobalConfigHandler::initialize() {
ReturnValue_t result = SystemObject::initialize(); ReturnValue_t result = SystemObject::initialize();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::initialize: SystemObject::initialize() failed with " << result << std::endl; sif::info << "GlobalConfigHandler::initialize: SystemObject::initialize() failed with "
<< result << std::endl;
#endif #endif
return result; return result;
} }
result = ReadConfigFile(); result = ReadConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::initialize: Creating JSON file at " << getFullName() << std::endl; sif::info << "GlobalConfigHandler::initialize: Creating JSON file at " << getFullName()
<< std::endl;
#endif #endif
result = ResetConfigFile(); result = ResetConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
@ -45,15 +44,12 @@ ReturnValue_t GlobalConfigHandler::initialize(){
} }
} }
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::initialize success " << std::endl; sif::info << "GlobalConfigHandler::initialize success " << std::endl;
#endif #endif
return result; return result;
} }
GlobalConfigHandler::~GlobalConfigHandler() { GlobalConfigHandler::~GlobalConfigHandler() {}
}
ReturnValue_t GlobalConfigHandler::performOperation(uint8_t operationCode) { ReturnValue_t GlobalConfigHandler::performOperation(uint8_t operationCode) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
@ -61,8 +57,6 @@ ReturnValue_t GlobalConfigHandler::performOperation(uint8_t operationCode) {
return result; return result;
} }
ReturnValue_t GlobalConfigHandler::lockConfigFile() { ReturnValue_t GlobalConfigHandler::lockConfigFile() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
result = configLock->lockMutex(MutexIF::TimeoutType::WAITING, 10); result = configLock->lockMutex(MutexIF::TimeoutType::WAITING, 10);
@ -74,14 +68,16 @@ ReturnValue_t GlobalConfigHandler::unlockConfigFile(){
return result; return result;
} }
template <typename T> ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data){ template <typename T>
ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
ReturnValue_t resultSet = RETURN_OK; ReturnValue_t resultSet = RETURN_OK;
result = lockConfigFile(); result = lockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::setConfigFileValue lock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::setConfigFileValue lock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -89,10 +85,12 @@ template <typename T> ReturnValue_t GlobalConfigHandler::setConfigFileValue(Para
std::string paramString; std::string paramString;
paramString = PARAM_KEY_MAP[paramID]; paramString = PARAM_KEY_MAP[paramID];
//Check if key exists in map before setting value. No check is done in setValue! Somehow PARAM_KEY_MAP.count(paramID) == 0 does not work // Check if key exists in map before setting value. No check is done in setValue! Somehow
// PARAM_KEY_MAP.count(paramID) == 0 does not work
if (paramString.empty() == true) { if (paramString.empty() == true) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::setConfigFileValue ParamId " << PARAM_KEY_MAP[paramID]<<" not found!" << std::endl; sif::info << "GlobalConfigHandler::setConfigFileValue ParamId " << PARAM_KEY_MAP[paramID]
<< " not found!" << std::endl;
#endif #endif
triggerEvent(SET_CONFIGFILEVALUE_FAILED, 1, 0); triggerEvent(SET_CONFIGFILEVALUE_FAILED, 1, 0);
return RETURN_FAILED; return RETURN_FAILED;
@ -102,29 +100,32 @@ template <typename T> ReturnValue_t GlobalConfigHandler::setConfigFileValue(Para
if (resultSet != RETURN_OK) { if (resultSet != RETURN_OK) {
triggerEvent(SET_CONFIGFILEVALUE_FAILED, 0, 0); triggerEvent(SET_CONFIGFILEVALUE_FAILED, 0, 0);
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::setConfigFileValue set json failed with " << resultSet << std::endl; sif::info << "GlobalConfigHandler::setConfigFileValue set json failed with " << resultSet
<< std::endl;
#endif #endif
} }
result = unlockConfigFile(); result = unlockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::setConfigFileValue unlock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::setConfigFileValue unlock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
return resultSet; return resultSet;
} }
template <typename T> ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data){ template <typename T>
ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
ReturnValue_t resultGet = RETURN_OK; ReturnValue_t resultGet = RETURN_OK;
result = lockConfigFile(); result = lockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::getConfigFileValue lock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::getConfigFileValue lock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -133,13 +134,15 @@ template <typename T> ReturnValue_t GlobalConfigHandler::getConfigFileValue(Para
if (resultGet != RETURN_OK) { if (resultGet != RETURN_OK) {
triggerEvent(GET_CONFIGFILEVALUE_FAILED, 0, 0); triggerEvent(GET_CONFIGFILEVALUE_FAILED, 0, 0);
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::getConfigFileValue getValue failed with " << resultGet << std::endl; sif::info << "GlobalConfigHandler::getConfigFileValue getValue failed with " << resultGet
<< std::endl;
#endif #endif
} }
result = unlockConfigFile(); result = unlockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::getConfigFileValue unlock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::getConfigFileValue unlock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -152,18 +155,19 @@ ReturnValue_t GlobalConfigHandler::resetConfigFileValues(){
result = lockConfigFile(); result = lockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::resetConfigFileValues lock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::resetConfigFileValues lock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
insertValue(PARAM_KEY_MAP[PARAM0], PARAM0_DEFAULT); insertValue(PARAM_KEY_MAP[PARAM0], PARAM0_DEFAULT);
insertValue(PARAM_KEY_MAP[PARAM1], PARAM1_DEFAULT); insertValue(PARAM_KEY_MAP[PARAM1], PARAM1_DEFAULT);
result = unlockConfigFile(); result = unlockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::resetConfigFileValues unlock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::resetConfigFileValues unlock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -175,7 +179,8 @@ ReturnValue_t GlobalConfigHandler::WriteConfigFile(){
result = lockConfigFile(); result = lockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::WriteConfigFile lock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::WriteConfigFile lock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -184,15 +189,16 @@ ReturnValue_t GlobalConfigHandler::WriteConfigFile(){
if (resultWrite != RETURN_OK) { if (resultWrite != RETURN_OK) {
triggerEvent(WRITE_CONFIGFILE_FAILED, 0, 0); triggerEvent(WRITE_CONFIGFILE_FAILED, 0, 0);
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::WriteConfigFile write json failed with " << resultWrite << std::endl; sif::info << "GlobalConfigHandler::WriteConfigFile write json failed with " << resultWrite
<< std::endl;
#endif #endif
} }
result = unlockConfigFile(); result = unlockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::WriteConfigFile unlock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::WriteConfigFile unlock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -204,7 +210,8 @@ ReturnValue_t GlobalConfigHandler::ReadConfigFile(){
result = lockConfigFile(); result = lockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::ReadConfigFile lock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::ReadConfigFile lock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -213,14 +220,16 @@ ReturnValue_t GlobalConfigHandler::ReadConfigFile(){
if (resultRead != RETURN_OK) { if (resultRead != RETURN_OK) {
triggerEvent(READ_CONFIGFILE_FAILED, 0, 0); triggerEvent(READ_CONFIGFILE_FAILED, 0, 0);
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::ReadConfigFile read json failed with " << resultRead << std::endl; sif::info << "GlobalConfigHandler::ReadConfigFile read json failed with " << resultRead
<< std::endl;
#endif #endif
} }
result = unlockConfigFile(); result = unlockConfigFile();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "GlobalConfigHandler::ReadConfigFile unlock mutex failed with " << result << std::endl; sif::info << "GlobalConfigHandler::ReadConfigFile unlock mutex failed with " << result
<< std::endl;
#endif #endif
return result; return result;
} }
@ -240,22 +249,20 @@ ReturnValue_t GlobalConfigHandler::ResetConfigFile(){
return result; return result;
} }
ReturnValue_t GlobalConfigHandler::setConfigFileName(std::string configFileName) { ReturnValue_t GlobalConfigHandler::setConfigFileName(std::string configFileName) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
setFullName(configFileName); setFullName(configFileName);
result = ResetConfigFile(); result = ResetConfigFile();
return result; return result;
} }
std::string GlobalConfigHandler::getConfigFileName(){ std::string GlobalConfigHandler::getConfigFileName() { return getFullName(); }
return getFullName(); template ReturnValue_t GlobalConfigHandler::getConfigFileValue<double>(ParamIds paramID,
} double& data);
template ReturnValue_t GlobalConfigHandler::getConfigFileValue<int32_t>(ParamIds paramID,
int32_t& data);
template ReturnValue_t GlobalConfigHandler::getConfigFileValue<double>(ParamIds paramID, double& data);
template ReturnValue_t GlobalConfigHandler::getConfigFileValue<int32_t>(ParamIds paramID, int32_t& data);
template ReturnValue_t GlobalConfigHandler::setConfigFileValue<double>(ParamIds paramID, double data);
template ReturnValue_t GlobalConfigHandler::setConfigFileValue<int32_t>(ParamIds paramID, int32_t data);
template ReturnValue_t GlobalConfigHandler::setConfigFileValue<double>(ParamIds paramID,
double data);
template ReturnValue_t GlobalConfigHandler::setConfigFileValue<int32_t>(ParamIds paramID,
int32_t data);

View File

@ -8,20 +8,21 @@
#ifndef MISSION_UTILITY_GLOBALCONFIGHANDLER_H_ #ifndef MISSION_UTILITY_GLOBALCONFIGHANDLER_H_
#define MISSION_UTILITY_GLOBALCONFIGHANDLER_H_ #define MISSION_UTILITY_GLOBALCONFIGHANDLER_H_
#include <fsfw/action/ActionHelper.h>
#include <fsfw/action/HasActionsIF.h>
#include <fsfw/objectmanager/SystemObject.h> #include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/storagemanager/StorageManagerIF.h> #include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/tasks/ExecutableObjectIF.h> #include <fsfw/tasks/ExecutableObjectIF.h>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include "mission/memory/NVMParameterBase.h" #include "GlobalConfigFileDefinitions.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "fsfw/parameters/HasParametersIF.h" #include "fsfw/parameters/HasParametersIF.h"
#include "fsfw/parameters/ParameterHelper.h" #include "fsfw/parameters/ParameterHelper.h"
#include <fsfw/action/ActionHelper.h> #include "mission/memory/NVMParameterBase.h"
#include <fsfw/action/HasActionsIF.h>
#include "GlobalConfigFileDefinitions.h"
static std::map<ParamIds, std::string> PARAM_KEY_MAP = { static std::map<ParamIds, std::string> PARAM_KEY_MAP = {
{PARAM0, "Parameter0"}, {PARAM0, "Parameter0"},
@ -29,8 +30,9 @@ static std::map<ParamIds, std::string> PARAM_KEY_MAP = {
}; };
/* /*
* Idea: This class is intended to be used as a subclass for the Core Controller. * Idea: This class is intended to be used as a subclass for the Core Controller.
* Its tasks is managing a configuration JSON file containing config values important for various object. * Its tasks is managing a configuration JSON file containing config values important for various
* If some function to read or write a config value is called, a mutex should be used so only one call is done at a time. * object. If some function to read or write a config value is called, a mutex should be used so
* only one call is done at a time.
*/ */
class GlobalConfigHandler : public SystemObject, class GlobalConfigHandler : public SystemObject,
public ExecutableObjectIF, public ExecutableObjectIF,
@ -51,10 +53,10 @@ public:
ReturnValue_t initialize(); ReturnValue_t initialize();
template <typename T>
template <typename T> ReturnValue_t setConfigFileValue(ParamIds paramID, T data); ReturnValue_t setConfigFileValue(ParamIds paramID, T data);
template <typename T> ReturnValue_t getConfigFileValue(ParamIds paramID, T& data); template <typename T>
ReturnValue_t getConfigFileValue(ParamIds paramID, T& data);
ReturnValue_t ResetConfigFile(); ReturnValue_t ResetConfigFile();
ReturnValue_t WriteConfigFile(); ReturnValue_t WriteConfigFile();
@ -72,9 +74,6 @@ private:
ReturnValue_t ReadConfigFile(); ReturnValue_t ReadConfigFile();
MessageQueueIF* commandQueue; MessageQueueIF* commandQueue;
}; };
#endif /* MISSION_UTILITY_GLOBALCONFIGHANDLER_H_ */ #endif /* MISSION_UTILITY_GLOBALCONFIGHANDLER_H_ */

View File

@ -1,16 +1,16 @@
#include <mission/utility/GlobalConfigHandler.h> #include <mission/utility/GlobalConfigHandler.h>
#include <objects/systemObjectList.h>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "../testEnvironment.h" #include "../testEnvironment.h"
#include <objects/systemObjectList.h>
TEST_CASE("Configfile Handler", "[ConfigHandler]") { TEST_CASE("Configfile Handler", "[ConfigHandler]") {
sif::debug << "Testcase config file handler" << std::endl; sif::debug << "Testcase config file handler" << std::endl;
testEnvironment::initialize(); testEnvironment::initialize();
// Init handler // Init handler
@ -59,7 +59,7 @@ TEST_CASE("Configfile Handler", "[ConfigHandler]") {
REQUIRE(doubleData == 5.0); REQUIRE(doubleData == 5.0);
// Test invalid Parameter // Test invalid Parameter
REQUIRE(confighandler.getConfigFileValue(PARAM2, doubleData) != HasReturnvaluesIF::RETURN_OK);//NVMParameterBase::KEY_NOT_EXISTS is private, why? REQUIRE(confighandler.getConfigFileValue(PARAM2, doubleData) !=
HasReturnvaluesIF::RETURN_OK); // NVMParameterBase::KEY_NOT_EXISTS is private, why?
REQUIRE(confighandler.setConfigFileValue(PARAM2, doubleData) != HasReturnvaluesIF::RETURN_OK); REQUIRE(confighandler.setConfigFileValue(PARAM2, doubleData) != HasReturnvaluesIF::RETURN_OK);
} }