Code refactoring and bug fixes for config file handler. Added new test cases for config file handler
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -12,13 +12,13 @@
|
||||
TEST_CASE("Configfile Handler", "[ConfigHandler]") {
|
||||
|
||||
sif::debug<<"Testcase config file handler"<<std::endl;
|
||||
|
||||
testEnvironment::initialize();
|
||||
//Init handler
|
||||
GlobalConfigHandler confighandler= GlobalConfigHandler(objects::CONFIG_TEST,"JSON.config");
|
||||
REQUIRE(confighandler.initialize() == HasReturnvaluesIF::RETURN_OK);
|
||||
|
||||
//Reset handler
|
||||
REQUIRE(confighandler.resetConfigFileValues() == HasReturnvaluesIF::RETURN_OK);
|
||||
REQUIRE(confighandler.ResetConfigFile() == HasReturnvaluesIF::RETURN_OK);
|
||||
|
||||
//Get and set double as well as int values
|
||||
double doubleData=0.0;
|
||||
@ -52,10 +52,14 @@ TEST_CASE("Configfile Handler", "[ConfigHandler]") {
|
||||
REQUIRE(confighandler.getConfigFileName()=="JSON.config");
|
||||
|
||||
//Reset and check if it worked
|
||||
REQUIRE(confighandler.resetConfigFileValues() == HasReturnvaluesIF::RETURN_OK);
|
||||
REQUIRE(confighandler.ResetConfigFile() == HasReturnvaluesIF::RETURN_OK);
|
||||
|
||||
doubleData=0.0;
|
||||
REQUIRE(confighandler.getConfigFileValue(PARAM0, doubleData) == HasReturnvaluesIF::RETURN_OK);
|
||||
REQUIRE(doubleData==5.0);
|
||||
|
||||
//Test invalid Parameter
|
||||
REQUIRE(confighandler.getConfigFileValue(PARAM2, doubleData) != HasReturnvaluesIF::RETURN_OK);//NVMParameterBase::KEY_NOT_EXISTS is private, why?
|
||||
REQUIRE(confighandler.setConfigFileValue(PARAM2, doubleData) != HasReturnvaluesIF::RETURN_OK);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user