From 7ab617accb4ff5a5bcd656b720091fc11d4ee6a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 May 2022 18:59:39 +0200 Subject: [PATCH] rudimentary clion support --- .gitignore | 8 ++++++++ .idea/codeStyles/Project.xml | 14 ++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 +++++ .run/fsfw-tests_coverage.run.xml | 7 +++++++ .run/fsfw.run.xml | 7 +++++++ tests/src/fsfw_tests/unit/CatchDefinitions.cpp | 5 +++-- tests/src/fsfw_tests/unit/CatchSetup.cpp | 12 +----------- tests/src/fsfw_tests/unit/cfdp/testTlvsLvs.cpp | 4 ++-- .../pollingsequence/PollingSequenceFactory.cpp | 12 ++++-------- 9 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .run/fsfw-tests_coverage.run.xml create mode 100644 .run/fsfw.run.xml diff --git a/.gitignore b/.gitignore index d6efb9cf..eb461072 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,14 @@ +# PyCharm and CLion +/.idea/* +!/.idea/runConfigurations +!/.idea/cmake.xml +!/.idea/codeStyles + +# Eclipse .cproject .project .settings .metadata /build* +/cmake-build* diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..0f3b1a4b --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..79ee123c --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.run/fsfw-tests_coverage.run.xml b/.run/fsfw-tests_coverage.run.xml new file mode 100644 index 00000000..49d9b135 --- /dev/null +++ b/.run/fsfw-tests_coverage.run.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.run/fsfw.run.xml b/.run/fsfw.run.xml new file mode 100644 index 00000000..72f74939 --- /dev/null +++ b/.run/fsfw.run.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/tests/src/fsfw_tests/unit/CatchDefinitions.cpp b/tests/src/fsfw_tests/unit/CatchDefinitions.cpp index 85e3aad0..da888016 100644 --- a/tests/src/fsfw_tests/unit/CatchDefinitions.cpp +++ b/tests/src/fsfw_tests/unit/CatchDefinitions.cpp @@ -1,7 +1,8 @@ #include "CatchDefinitions.h" #include -#include + +#include "fsfw/serviceinterface.h" StorageManagerIF* tglob::getIpcStoreHandle() { if (ObjectManager::instance() != nullptr) { @@ -10,7 +11,7 @@ StorageManagerIF* tglob::getIpcStoreHandle() { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Global object manager uninitialized" << std::endl; #else - sif::printError("Global object manager uninitialized\n\r"); + FSFW_LOGE("Global object manager uninitialized\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ return nullptr; } diff --git a/tests/src/fsfw_tests/unit/CatchSetup.cpp b/tests/src/fsfw_tests/unit/CatchSetup.cpp index 06f5190a..f5a3cb06 100644 --- a/tests/src/fsfw_tests/unit/CatchSetup.cpp +++ b/tests/src/fsfw_tests/unit/CatchSetup.cpp @@ -6,24 +6,14 @@ #endif #include "fsfw/objectmanager/ObjectManager.h" -#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/storagemanager/StorageManagerIF.h" /* 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"); -ServiceInterfaceStream info("INFO"); -ServiceInterfaceStream error("ERROR"); -ServiceInterfaceStream warning("WARNING"); -} // namespace sif -#endif - int customSetup() { // global setup + sif::initialize(); ObjectManager* objMan = ObjectManager::instance(); objMan->setObjectFactoryFunction(Factory::produceFrameworkObjects, nullptr); objMan->initialize(); diff --git a/tests/src/fsfw_tests/unit/cfdp/testTlvsLvs.cpp b/tests/src/fsfw_tests/unit/cfdp/testTlvsLvs.cpp index c251fd15..10800c20 100644 --- a/tests/src/fsfw_tests/unit/cfdp/testTlvsLvs.cpp +++ b/tests/src/fsfw_tests/unit/cfdp/testTlvsLvs.cpp @@ -17,14 +17,14 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { using namespace cfdp; int result = HasReturnvaluesIF::RETURN_OK; - std::array rawBuf; + std::array rawBuf{}; uint8_t* serPtr = rawBuf.data(); const uint8_t* deserPtr = rawBuf.data(); size_t deserSize = 0; cfdp::EntityId sourceId = EntityId(cfdp::WidthInBytes::TWO_BYTES, 0x0ff0); SECTION("TLV Serialization") { - std::array tlvRawBuf; + std::array tlvRawBuf{}; serPtr = tlvRawBuf.data(); result = sourceId.serialize(&serPtr, &deserSize, tlvRawBuf.size(), SerializeIF::Endianness::NETWORK); diff --git a/tests/src/fsfw_tests/unit/testcfg/pollingsequence/PollingSequenceFactory.cpp b/tests/src/fsfw_tests/unit/testcfg/pollingsequence/PollingSequenceFactory.cpp index 0c44f6a2..10119639 100644 --- a/tests/src/fsfw_tests/unit/testcfg/pollingsequence/PollingSequenceFactory.cpp +++ b/tests/src/fsfw_tests/unit/testcfg/pollingsequence/PollingSequenceFactory.cpp @@ -1,9 +1,9 @@ #include "PollingSequenceFactory.h" #include -#include #include +#include "fsfw/serviceinterface.h" #include "tests/TestsConfig.h" ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) { @@ -11,8 +11,8 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) uint32_t length = thisSequence->getPeriodMs(); /* Add polling sequence table here */ - thisSequence->addSlot(objects::TEST_DEVICE, 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::TEST_DEVICE, 0.3, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TEST_DEVICE, 0 * length, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TEST_DEVICE, 0.3 * length, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::TEST_DEVICE, 0.45 * length, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::TEST_DEVICE, 0.6 * length, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TEST_DEVICE, 0.8 * length, DeviceHandlerIF::GET_READ); @@ -20,11 +20,7 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { return HasReturnvaluesIF::RETURN_OK; } else { -#if FSFW_CPP_OSTREAM_ENABLED - sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl; -#else - sif::printError("pst::pollingSequenceInitDefault: Sequence invalid!"); -#endif + FSFW_LOGE("pst::pollingSequenceInitDefault: Sequence invalid!\n"); return HasReturnvaluesIF::RETURN_FAILED; } }