move free call

This commit is contained in:
Robin Müller 2022-11-21 14:56:08 +01:00
parent 3bc3da5a8d
commit 65a5abab49
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 18 additions and 13 deletions

View File

@ -346,9 +346,15 @@ if(FSFW_BUILD_TESTS)
DEPENDENCIES ${FSFW_TEST_TGT}) DEPENDENCIES ${FSFW_TEST_TGT})
else() else()
setup_target_for_coverage_lcov( setup_target_for_coverage_lcov(
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT} NAME
DEPENDENCIES ${FSFW_TEST_TGT} ${FSFW_TEST_TGT}_coverage
GENHTML_ARGS --html-epilog ${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html) EXECUTABLE
${FSFW_TEST_TGT}
DEPENDENCIES
${FSFW_TEST_TGT}
GENHTML_ARGS
--html-epilog
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
endif() endif()
endif() endif()
endif() endif()

View File

@ -181,7 +181,8 @@ class StorageManagerIF {
* @return Returns @returnvalue::OK if data was added. * @return Returns @returnvalue::OK if data was added.
* @returnvalue::FAILED if data could not be added, storageId is unchanged then. * @returnvalue::FAILED if data could not be added, storageId is unchanged then.
*/ */
virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size, uint8_t** dataPtr) = 0; virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size,
uint8_t** dataPtr) = 0;
[[nodiscard]] virtual bool hasDataAtId(store_address_t storeId) const = 0; [[nodiscard]] virtual bool hasDataAtId(store_address_t storeId) const = 0;

View File

@ -20,15 +20,15 @@ UioMapper::UioMapper(std::string uioFile, int mapNum) : mapNum(mapNum) {
if (S_ISLNK(buf.st_mode)) { if (S_ISLNK(buf.st_mode)) {
char* res = realpath(uioFile.c_str(), nullptr); char* res = realpath(uioFile.c_str(), nullptr);
if (res) { if (res) {
this->uioFile = res; uioFile = res;
free(res);
} else { } else {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Could not resolve real path of UIO file " << uioFile << std::endl; sif::error << "Could not resolve real path of UIO file " << uioFile << std::endl;
#endif #endif
} }
free(res);
} else { } else {
this->uioFile = std::move(uioFile); uioFile = std::move(uioFile);
} }
} }

View File

@ -1,7 +1,5 @@
target_sources(${FSFW_TEST_TGT} PRIVATE testHostFilesystem.cpp testFsMock.cpp) target_sources(${FSFW_TEST_TGT} PRIVATE testHostFilesystem.cpp testFsMock.cpp)
if(UNIX) if(UNIX)
target_sources(${FSFW_TEST_TGT} PRIVATE target_sources(${FSFW_TEST_TGT} PRIVATE testCommandExecutor.cpp)
testCommandExecutor.cpp
)
endif() endif()

View File

@ -17,7 +17,7 @@ class FaultHandlerMock : public FaultHandlerBase {
void noticeOfSuspensionCb(TransactionId& id, ConditionCode code) override; void noticeOfSuspensionCb(TransactionId& id, ConditionCode code) override;
void noticeOfCancellationCb(TransactionId& id, ConditionCode code) override; void noticeOfCancellationCb(TransactionId& id, ConditionCode code) override;
void abandonCb(TransactionId& id,ConditionCode code) override; void abandonCb(TransactionId& id, ConditionCode code) override;
void ignoreCb(TransactionId& id, ConditionCode code) override; void ignoreCb(TransactionId& id, ConditionCode code) override;
FaultInfo& getFhInfo(FaultHandlerCode fhCode); FaultInfo& getFhInfo(FaultHandlerCode fhCode);