run auto-formatter
fsfw/fsfw/pipeline/pr-development This commit looks good Details

This commit is contained in:
Jakob Meier 2022-06-23 11:56:46 +02:00
parent 2d2f65bf89
commit df97bbc691
7 changed files with 20 additions and 19 deletions

View File

@ -696,7 +696,8 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
/* Configuration error */ /* Configuration error */
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed." << std::endl; sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed."
<< std::endl;
#else #else
sif::printWarning("LocalDataPoolManager::performPeriodicHkOperation: HK generation failed.\n"); sif::printWarning("LocalDataPoolManager::performPeriodicHkOperation: HK generation failed.\n");
#endif #endif

View File

@ -54,7 +54,7 @@ ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) {
// If the deadline was missed, the deadlineMissedFunc is called. // If the deadline was missed, the deadlineMissedFunc is called.
if (!PosixThread::delayUntil(&lastWakeTime, interval)) { if (!PosixThread::delayUntil(&lastWakeTime, interval)) {
// No time left on timer -> we missed the deadline // No time left on timer -> we missed the deadline
if(dlmFunc != nullptr){ if (dlmFunc != nullptr) {
dlmFunc(); dlmFunc();
} }
} }

View File

@ -95,9 +95,9 @@ void DeviceHandlerMock::resetPeriodicReplyState() { periodicReplyReceived = fals
bool DeviceHandlerMock::getPeriodicReplyReceived() { return periodicReplyReceived; } bool DeviceHandlerMock::getPeriodicReplyReceived() { return periodicReplyReceived; }
ReturnValue_t DeviceHandlerMock::enablePeriodicReply(DeviceCommandId_t replyId) { ReturnValue_t DeviceHandlerMock::enablePeriodicReply(DeviceCommandId_t replyId) {
return updatePeriodicReply(true, replyId); return updatePeriodicReply(true, replyId);
} }
ReturnValue_t DeviceHandlerMock::disablePeriodicReply(DeviceCommandId_t replyId) { ReturnValue_t DeviceHandlerMock::disablePeriodicReply(DeviceCommandId_t replyId) {
return updatePeriodicReply(false, replyId); return updatePeriodicReply(false, replyId);
} }

View File

@ -33,7 +33,7 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") {
deviceHandlerCommander.performOperation(); deviceHandlerCommander.performOperation();
result = deviceHandlerCommander.getReplyReturnCode(); result = deviceHandlerCommander.getReplyReturnCode();
uint32_t missedReplies = deviceFdirMock.getMissedReplyCount(); uint32_t missedReplies = deviceFdirMock.getMissedReplyCount();
REQUIRE(missedReplies == 0); REQUIRE(missedReplies == 0);
REQUIRE(result == HasReturnvaluesIF::RETURN_OK); REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
} }
@ -84,12 +84,12 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") {
// Test if disabling of periodic reply // Test if disabling of periodic reply
deviceHandlerMock.disablePeriodicReply(DeviceHandlerMock::PERIODIC_REPLY); deviceHandlerMock.disablePeriodicReply(DeviceHandlerMock::PERIODIC_REPLY);
deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION); deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION);
deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE); deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE);
deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE); deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE);
deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_READ); deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_READ);
deviceHandlerMock.performOperation(DeviceHandlerIF::GET_READ); deviceHandlerMock.performOperation(DeviceHandlerIF::GET_READ);
missedReplies = deviceFdirMock.getMissedReplyCount(); missedReplies = deviceFdirMock.getMissedReplyCount();
// Should still be 1 because periodic reply is now disabled // Should still be 1 because periodic reply is now disabled
REQUIRE(missedReplies == 1); REQUIRE(missedReplies == 1);
} }
} }

View File

@ -4,12 +4,12 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include "tests/TestsConfig.h"
#include "fsfw/container/DynamicFIFO.h" #include "fsfw/container/DynamicFIFO.h"
#include "fsfw/container/SimpleRingBuffer.h" #include "fsfw/container/SimpleRingBuffer.h"
#include "fsfw/platform.h" #include "fsfw/platform.h"
#include "fsfw/serviceinterface.h" #include "fsfw/serviceinterface.h"
#include "fsfw_hal/linux/CommandExecutor.h" #include "fsfw_hal/linux/CommandExecutor.h"
#include "tests/TestsConfig.h"
#ifdef PLATFORM_UNIX #ifdef PLATFORM_UNIX

View File

@ -157,7 +157,7 @@ TEST_CASE("New Accessor", "[NewAccessor]") {
} }
} }
SECTION("Operators"){ SECTION("Operators") {
result = SimplePool.addData(&testStoreId, testDataArray.data(), size); result = SimplePool.addData(&testStoreId, testDataArray.data(), size);
REQUIRE(result == retval::CATCH_OK); REQUIRE(result == retval::CATCH_OK);
{ {
@ -173,13 +173,13 @@ TEST_CASE("New Accessor", "[NewAccessor]") {
REQUIRE(result == HasReturnvaluesIF::RETURN_OK); REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
CHECK(accessor2.getId() == testStoreId); CHECK(accessor2.getId() == testStoreId);
CHECK(accessor2.size() == 10); CHECK(accessor2.size() == 10);
std::array<uint8_t, 10> newData; std::array<uint8_t, 10> newData;
// Expect data to be invalid so this must return RETURN_FAILED // Expect data to be invalid so this must return RETURN_FAILED
result = accessor.getDataCopy(newData.data(),newData.size()); result = accessor.getDataCopy(newData.data(), newData.size());
REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED);
// Expect data to be too small // Expect data to be too small
result = accessor2.getDataCopy(data.data(),data.size()); result = accessor2.getDataCopy(data.data(), data.size());
REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED);
} }
} }

View File

@ -1,9 +1,9 @@
#include <fsfw/objectmanager/ObjectManager.h> #include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/storagemanager/LocalPool.h> #include <fsfw/storagemanager/LocalPool.h>
#include <array>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <cstring> #include <cstring>
#include <array>
#include "fsfw_tests/unit/CatchDefinitions.h" #include "fsfw_tests/unit/CatchDefinitions.h"