diff --git a/datapoollocal/LocalPoolVariable.h b/datapoollocal/LocalPoolVariable.h index 84be54b1..21ee2764 100644 --- a/datapoollocal/LocalPoolVariable.h +++ b/datapoollocal/LocalPoolVariable.h @@ -7,6 +7,7 @@ #include "../datapool/PoolVariableIF.h" #include "../datapool/DataSetIF.h" +#include "../serviceinterface/ServiceInterface.h" #include "../objectmanager/ObjectManagerIF.h" #include "../serialize/SerializeAdapter.h" diff --git a/datapoollocal/LocalPoolVariable.tpp b/datapoollocal/LocalPoolVariable.tpp index 153a13d0..f35c8be2 100644 --- a/datapoollocal/LocalPoolVariable.tpp +++ b/datapoollocal/LocalPoolVariable.tpp @@ -35,8 +35,11 @@ inline ReturnValue_t LocalPoolVariable::readWithoutLock() { if(readWriteMode == pool_rwm_t::VAR_WRITE) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "LocalPoolVariable: Invalid read write " - "mode for read() call." << std::endl; -#endif + "mode for read call." << std::endl; +#else + fsfw::printWarning("LocalPoolVariable: Invalid read write " + "mode for read call."); +#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return PoolVariableIF::INVALID_READ_WRITE_MODE; } @@ -48,7 +51,11 @@ inline ReturnValue_t LocalPoolVariable::readWithoutLock() { << std::hex << std::setw(8) << std::setfill('0') << hkManager->getOwner() << " and lp ID 0x" << localPoolId << std::dec << " failed." << std::setfill(' ') << std::endl; -#endif +#else + fsfw::printError("LocalPoolVariable: Read of local pool variable of " + "object 0x%08x and lp ID 0x08x failed.", hkManager->getOwner(), + localPoolId); +#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return result; } this->value = *(poolEntry->address); @@ -69,7 +76,7 @@ inline ReturnValue_t LocalPoolVariable::commitWithoutLock() { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "LocalPoolVariable: Invalid read write " "mode for commit() call." << std::endl; -#endif +#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return PoolVariableIF::INVALID_READ_WRITE_MODE; } PoolEntry* poolEntry = nullptr; @@ -80,7 +87,11 @@ inline ReturnValue_t LocalPoolVariable::commitWithoutLock() { << "object " << std::hex << std::setw(8) << std::setfill('0') << hkManager->getOwner() << " and lp ID 0x" << localPoolId << std::dec << " failed." << std::endl; -#endif +#else + fsfw::printError("LocalPoolVariable: Read of local pool variable of " + "object 0x%08x and lp ID 0x08x failed.", hkManager->getOwner(), + localPoolId); +#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return result; } *(poolEntry->address) = this->value; diff --git a/unittest/internal/UnittDefinitions.h b/unittest/internal/UnittDefinitions.h index ea36fea4..d319f4bc 100644 --- a/unittest/internal/UnittDefinitions.h +++ b/unittest/internal/UnittDefinitions.h @@ -5,6 +5,7 @@ #include "../../serviceinterface/ServiceInterfaceStream.h" #include #include +#include namespace tv { // POD test values diff --git a/unittest/tests/action/TestActionHelper.cpp b/unittest/tests/action/TestActionHelper.cpp index 3109eba1..3957bba2 100644 --- a/unittest/tests/action/TestActionHelper.cpp +++ b/unittest/tests/action/TestActionHelper.cpp @@ -7,6 +7,8 @@ #include +#include + TEST_CASE( "Action Helper" , "[ActionHelper]") { ActionHelperOwnerMockBase testDhMock; diff --git a/unittest/tests/datapoollocal/LocalPoolVariableTest.cpp b/unittest/tests/datapoollocal/LocalPoolVariableTest.cpp index b173089c..cf4f4b6b 100644 --- a/unittest/tests/datapoollocal/LocalPoolVariableTest.cpp +++ b/unittest/tests/datapoollocal/LocalPoolVariableTest.cpp @@ -90,7 +90,9 @@ TEST_CASE("LocalPoolVariable" , "[LocPoolVarTest]") { lp_var_t uint32tVar = lp_var_t( objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint32VarId); +#if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "LocalPoolVariable printout: " < #include StorageManagerIF* tglob::getIpcStoreHandle() { @@ -7,6 +8,8 @@ StorageManagerIF* tglob::getIpcStoreHandle() { } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Global object manager uninitialized" << std::endl; +#else + fsfw::printError("Global object manager uninitialized"); #endif return nullptr; } diff --git a/unittest/user/unittest/core/CatchFactory.cpp b/unittest/user/unittest/core/CatchFactory.cpp index 3177212f..0597f08c 100644 --- a/unittest/user/unittest/core/CatchFactory.cpp +++ b/unittest/user/unittest/core/CatchFactory.cpp @@ -1,11 +1,15 @@ +#include +#include #include "CatchFactory.h" #include #include - #include #include #include +#include +#include +#include /** * @brief Produces system objects. @@ -50,7 +54,23 @@ void Factory::produce(void) { } void Factory::setStaticFrameworkObjectIds() { + PusServiceBase::packetSource = objects::NO_OBJECT; + PusServiceBase::packetDestination = objects::NO_OBJECT; + CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT; + CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT; + + VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; + + DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; + DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS; + + LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT; + + DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT; + + TmPacketStored::timeStamperId = objects::NO_OBJECT; } + diff --git a/unittest/user/unittest/core/CatchRunner.cpp b/unittest/user/unittest/core/CatchRunner.cpp index 35c53cd4..886d641f 100644 --- a/unittest/user/unittest/core/CatchRunner.cpp +++ b/unittest/user/unittest/core/CatchRunner.cpp @@ -1,17 +1,16 @@ /** - * @file CatchSource.cpp + * @file CatchRunner.cpp * @brief Source file to compile catch framework. * @details All tests should be written in other files. * For eclipse console output, install ANSI Escape in Console * from the eclipse market place to get colored characters. */ -#ifndef NO_UNIT_TEST_FRAMEWORK +#include -#define CATCH_CONFIG_RUNNER -#include +#define CATCH_CONFIG_COLOUR_WINDOWS -#if CUSTOM_UNITTEST_RUNNER == 0 +#include extern int customSetup(); @@ -25,7 +24,3 @@ int main( int argc, char* argv[] ) { return result; } -#endif - - -#endif diff --git a/unittest/user/unittest/core/CatchSetup.cpp b/unittest/user/unittest/core/CatchSetup.cpp index c93cf032..bda31400 100644 --- a/unittest/user/unittest/core/CatchSetup.cpp +++ b/unittest/user/unittest/core/CatchSetup.cpp @@ -1,21 +1,20 @@ -#include +#include "CatchFactory.h" #include "CatchDefinitions.h" -#include #ifdef GCOV #include #endif -#include "../../objectmanager/ObjectManager.h" -#include "../../objectmanager/ObjectManagerIF.h" -#include "../../storagemanager/StorageManagerIF.h" -#include "../../serviceinterface/ServiceInterfaceStream.h" +#include +#include +#include +#include /* Global instantiations normally done in main.cpp */ /* Initialize Data Pool */ - +#if FSFW_CPP_OSTREAM_ENABLED == 1 namespace sif { /* Set up output streams */ ServiceInterfaceStream debug("DEBUG"); @@ -23,6 +22,7 @@ ServiceInterfaceStream info("INFO"); ServiceInterfaceStream error("ERROR"); ServiceInterfaceStream warning("WARNING"); } +#endif /* Global object manager */ ObjectManagerIF *objectManager; diff --git a/unittest/user/unittest/core/printChar.cpp b/unittest/user/unittest/core/printChar.cpp index 755a13b2..5d4f1b17 100644 --- a/unittest/user/unittest/core/printChar.cpp +++ b/unittest/user/unittest/core/printChar.cpp @@ -1,4 +1,4 @@ -#include +#include "printChar.h" #include void printChar(const char* character, bool errStream) {