From 09815f5cce17deefb9435ffc9c9b55b5b8d6f3ce Mon Sep 17 00:00:00 2001 From: Steffen Gaisser Date: Wed, 23 Feb 2022 18:24:07 +0100 Subject: [PATCH] Clang format --- src/fsfw/cfdp/tlv/FilestoreTlvBase.h | 2 +- src/fsfw/osal/linux/BinarySemaphore.cpp | 3 +-- src/fsfw/rmap/RMAPChannelIF.h | 6 ++--- src/fsfw/storagemanager/LocalPool.cpp | 4 ++-- src/fsfw/timemanager/CCSDSTime.cpp | 6 ++--- .../unit/timemanager/TestCCSDSTime.cpp | 22 +++++++++---------- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h index c123f94c2..9a02c2132 100644 --- a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h +++ b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h @@ -1,12 +1,12 @@ #ifndef FSFW_SRC_FSFW_CFDP_FILESTOREREQUESTBASE_H_ #define FSFW_SRC_FSFW_CFDP_FILESTOREREQUESTBASE_H_ +#include #include #include #include #include #include -#include #include #include diff --git a/src/fsfw/osal/linux/BinarySemaphore.cpp b/src/fsfw/osal/linux/BinarySemaphore.cpp index 536681a6d..4fb67f15d 100644 --- a/src/fsfw/osal/linux/BinarySemaphore.cpp +++ b/src/fsfw/osal/linux/BinarySemaphore.cpp @@ -1,6 +1,7 @@ #include "fsfw/osal/linux/BinarySemaphore.h" #include +#include #include #include @@ -9,8 +10,6 @@ #include "fsfw/serviceinterface/ServiceInterfacePrinter.h" #include "fsfw/serviceinterface/ServiceInterfaceStream.h" -#include - BinarySemaphore::BinarySemaphore() { // Using unnamed semaphores for now initSemaphore(); diff --git a/src/fsfw/rmap/RMAPChannelIF.h b/src/fsfw/rmap/RMAPChannelIF.h index 56ede1e2b..9e666dfb6 100644 --- a/src/fsfw/rmap/RMAPChannelIF.h +++ b/src/fsfw/rmap/RMAPChannelIF.h @@ -77,9 +77,9 @@ class RMAPChannelIF { * command; command was not sent * - @c COMMAND_BUFFER_FULL no receiver buffer available for * expected len; command was not sent - * - @c COMMAND_TOO_BIG the data that was to be sent was too long - * for the hw to handle (write command) or the expected len was bigger than maximal expected len - * (read command) command was not sent + * - @c COMMAND_TOO_BIG the data that was to be sent was too + * long for the hw to handle (write command) or the expected len was bigger than maximal expected + * len (read command) command was not sent * - @c COMMAND_CHANNEL_DEACTIVATED the channel has no port set * - @c NOT_SUPPORTED if you dont feel like * implementing something... diff --git a/src/fsfw/storagemanager/LocalPool.cpp b/src/fsfw/storagemanager/LocalPool.cpp index 9bd12b4d3..6acedacab 100644 --- a/src/fsfw/storagemanager/LocalPool.cpp +++ b/src/fsfw/storagemanager/LocalPool.cpp @@ -1,9 +1,9 @@ #include "fsfw/storagemanager/LocalPool.h" -#include - #include +#include + #include "fsfw/FSFW.h" #include "fsfw/objectmanager/ObjectManager.h" diff --git a/src/fsfw/timemanager/CCSDSTime.cpp b/src/fsfw/timemanager/CCSDSTime.cpp index 9a92c21e6..290d58dce 100644 --- a/src/fsfw/timemanager/CCSDSTime.cpp +++ b/src/fsfw/timemanager/CCSDSTime.cpp @@ -127,7 +127,7 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f } to->month = tempMonth; to->day = tempDay; - }else{ + } else { to->month = temp->month; to->day = temp->day; } @@ -228,8 +228,8 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* } // try Code B (yyyy-ddd) - count = sscanf((const char*)from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu8 ":%2" SCNu8 ":%fZ", &year, &day, - &hour, &minute, &second); + count = sscanf((const char*)from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu8 ":%2" SCNu8 ":%fZ", &year, + &day, &hour, &minute, &second); if (count == 5) { uint8_t tempDay; ReturnValue_t result = CCSDSTime::convertDaysOfYear(day, year, &month, &tempDay); diff --git a/tests/src/fsfw_tests/unit/timemanager/TestCCSDSTime.cpp b/tests/src/fsfw_tests/unit/timemanager/TestCCSDSTime.cpp index 783517a6a..89713488b 100644 --- a/tests/src/fsfw_tests/unit/timemanager/TestCCSDSTime.cpp +++ b/tests/src/fsfw_tests/unit/timemanager/TestCCSDSTime.cpp @@ -1,9 +1,8 @@ -#include - #include -#include +#include #include +#include #include "fsfw_tests/unit/CatchDefinitions.h" @@ -53,11 +52,12 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { REQUIRE(timeTo.second == 45); REQUIRE(timeTo.usecond == 123400); } - SECTION("CCS_Day of Year"){ + SECTION("CCS_Day of Year") { Clock::TimeOfDay_t timeTo; - std::array ccsDayOfYear = {0b01011000, 0x07, 0xe4, 0, 60, 13, 24, 45}; + std::array ccsDayOfYear = {0b01011000, 0x07, 0xe4, 0, 60, 13, 24, 45}; size_t length = ccsDayOfYear.size(); - auto result = CCSDSTime::convertFromCCS(&timeTo, ccsDayOfYear.data(), &length, ccsDayOfYear.size()); + auto result = + CCSDSTime::convertFromCCS(&timeTo, ccsDayOfYear.data(), &length, ccsDayOfYear.size()); REQUIRE(result == HasReturnvaluesIF::RETURN_OK); // Check constness REQUIRE(ccsDayOfYear[0] == 0b01011000); @@ -76,11 +76,11 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { REQUIRE(timeTo.second == 45); REQUIRE(timeTo.usecond == 0); } - SECTION("Test convertFromASCII"){ - std::string timeAscii = "2022-12-31T23:59:59.123Z"; - Clock::TimeOfDay_t timeTo; - const uint8_t* timeChar = reinterpret_cast(timeAscii.c_str()); - CCSDSTime::convertFromASCII(&timeTo, timeChar, timeAscii.length()); + SECTION("Test convertFromASCII") { + std::string timeAscii = "2022-12-31T23:59:59.123Z"; + Clock::TimeOfDay_t timeTo; + const uint8_t* timeChar = reinterpret_cast(timeAscii.c_str()); + CCSDSTime::convertFromASCII(&timeTo, timeChar, timeAscii.length()); REQUIRE(timeTo.year == 2022); REQUIRE(timeTo.month == 12); REQUIRE(timeTo.day == 31);