Applied clang format

This commit is contained in:
Steffen Gaisser 2022-03-25 18:48:53 +01:00
parent 10398855a9
commit 665d8cd479
10 changed files with 226 additions and 229 deletions

View File

@ -2,9 +2,9 @@
#include <chrono> #include <chrono>
#include "fsfw/ipc/MutexGuard.h"
#include "fsfw/platform.h" #include "fsfw/platform.h"
#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/ipc/MutexGuard.h"
#if defined(PLATFORM_WIN) #if defined(PLATFORM_WIN)
#include <sysinfoapi.h> #include <sysinfoapi.h>

View File

@ -8,8 +8,8 @@
#include <fstream> #include <fstream>
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/ipc/MutexGuard.h" #include "fsfw/ipc/MutexGuard.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
uint32_t Clock::getTicksPerSecond(void) { uint32_t Clock::getTicksPerSecond(void) {
uint32_t ticks = sysconf(_SC_CLK_TCK); uint32_t ticks = sysconf(_SC_CLK_TCK);

View File

@ -6,7 +6,6 @@
#include "fsfw/ipc/MutexGuard.h" #include "fsfw/ipc/MutexGuard.h"
#include "fsfw/osal/rtems/RtemsBasic.h" #include "fsfw/osal/rtems/RtemsBasic.h"
uint32_t Clock::getTicksPerSecond(void) { uint32_t Clock::getTicksPerSecond(void) {
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second(); rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
return static_cast<uint32_t>(ticks_per_second); return static_cast<uint32_t>(ticks_per_second);

View File

@ -1,8 +1,9 @@
#include "version.h" #include "version.h"
#include "fsfw/FSFWVersion.h"
#include <cstdio> #include <cstdio>
#include "fsfw/FSFWVersion.h"
#ifdef major #ifdef major
#undef major #undef major
#endif #endif

View File

@ -1,8 +1,8 @@
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <fsfw/globalfunctions/timevalOperations.h> #include <fsfw/globalfunctions/timevalOperations.h>
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include "fsfw_tests/unit/CatchDefinitions.h" #include "fsfw_tests/unit/CatchDefinitions.h"
TEST_CASE("TimevalTest", "[timevalOperations]") { TEST_CASE("TimevalTest", "[timevalOperations]") {
@ -121,5 +121,4 @@ TEST_CASE("TimevalTest", "[timevalOperations]"){
REQUIRE(t1.tv_usec >= 123455); REQUIRE(t1.tv_usec >= 123455);
REQUIRE(t1.tv_usec <= 123457); REQUIRE(t1.tv_usec <= 123457);
} }
} }

View File

@ -1,9 +1,9 @@
#include <fsfw/timemanager/Clock.h>
#include <fsfw/globalfunctions/timevalOperations.h> #include <fsfw/globalfunctions/timevalOperations.h>
#include <fsfw/timemanager/Clock.h>
#include <array> #include <array>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp> #include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include "fsfw_tests/unit/CatchDefinitions.h" #include "fsfw_tests/unit/CatchDefinitions.h"
@ -54,7 +54,8 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]"){
double difference = timevalOperations::toDouble(timeAsTimeval - timeAsUsecTimeval); double difference = timevalOperations::toDouble(timeAsTimeval - timeAsUsecTimeval);
// We accept 5 ms difference // We accept 5 ms difference
CHECK(abs(difference) <= 0.005); CHECK(abs(difference) <= 0.005);
uint64_t timevalAsUint64 = static_cast<uint64_t>(timeAsTimeval.tv_sec)*1000000ull + static_cast<uint64_t>(timeAsTimeval.tv_usec); uint64_t timevalAsUint64 = static_cast<uint64_t>(timeAsTimeval.tv_sec) * 1000000ull +
static_cast<uint64_t>(timeAsTimeval.tv_usec);
if (timeAsUsec > timevalAsUint64) { if (timeAsUsec > timevalAsUint64) {
// This should not be the case but we can see some rounding issue sometimes // This should not be the case but we can see some rounding issue sometimes
// This is the case if used in valgrind. This might indicate an other issue // This is the case if used in valgrind. This might indicate an other issue
@ -64,7 +65,6 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]"){
CHECK((timevalAsUint64 - timeAsUsec) >= 0); CHECK((timevalAsUint64 - timeAsUsec) >= 0);
CHECK((timevalAsUint64 - timeAsUsec) <= (5 * 1000)); CHECK((timevalAsUint64 - timeAsUsec) <= (5 * 1000));
} }
} }
SECTION("Test j2000") { SECTION("Test j2000") {
double j2000; double j2000;

View File

@ -120,8 +120,6 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") {
CHECK(cdsTime.msDay_l == 0xC5); CHECK(cdsTime.msDay_l == 0xC5);
CHECK(cdsTime.msDay_ll == 0xC3); CHECK(cdsTime.msDay_ll == 0xC3);
// Conversion back to timeval // Conversion back to timeval
timeval timeReturnAsTimeval; timeval timeReturnAsTimeval;
result = CCSDSTime::convertFromCDS(&timeReturnAsTimeval, &cdsTime); result = CCSDSTime::convertFromCDS(&timeReturnAsTimeval, &cdsTime);