format
All checks were successful
fsfw/fsfw/pipeline/head This commit looks good

This commit is contained in:
Ulrich Mohr 2023-01-26 13:40:44 +01:00
parent 941bf61f28
commit e37af4fe70
32 changed files with 94 additions and 104 deletions

View File

@ -1,8 +1,8 @@
#ifndef FSFW_MEMORY_HASFILESYSTEMIF_H_
#define FSFW_MEMORY_HASFILESYSTEMIF_H_
#include <filesystem>
#include <cstddef>
#include <filesystem>
#include "FileSystemArgsIF.h"
#include "fsfw/ipc/MessageQueueIF.h"

View File

@ -24,8 +24,8 @@
#else
#ifdef WIN32
#include <winsock2.h>
#include <windows.h>
#include <winsock2.h>
#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN
#define BYTE_ORDER_SYSTEM LITTLE_ENDIAN
#else

View File

@ -40,6 +40,3 @@ timeval Clock::getUptime() {
// timeval uptime = getUptime();
// return uptime.tv_sec;
// }

View File

@ -78,4 +78,3 @@ timeval Clock::getUptime() {
#endif
return timeval;
}

View File

@ -10,7 +10,6 @@
#if defined(PLATFORM_WIN)
#include "fsfw/osal/windows/winTaskHelpers.h"
#elif defined(PLATFORM_UNIX)
#include <pthread.h>

View File

@ -3,8 +3,8 @@
#include <fsfw/returnvalues/returnvalue.h>
#include <thread>
#include <string>
#include <thread>
namespace tasks {

View File

@ -6,7 +6,6 @@
#include "fsfw/ipc/MutexGuard.h"
#include "fsfw/osal/rtems/RtemsBasic.h"
ReturnValue_t Clock::setClock(const timeval* time) {
TimeOfDay_t time_tod;
ReturnValue_t result = convertTimevalToTimeOfDay(time, &time_tod);
@ -20,7 +19,8 @@ ReturnValue_t Clock::setClock(const timeval* time) {
timeRtems.hour = time_tod.hour;
timeRtems.minute = time_tod.minute;
timeRtems.second = time_tod.second;
timeRtems.ticks = static_cast<uint64_t>(time_tod.usecond) * rtems_clock_get_ticks_per_second() / 1e6;
timeRtems.ticks =
static_cast<uint64_t>(time_tod.usecond) * rtems_clock_get_ticks_per_second() / 1e6;
rtems_status_code status = rtems_clock_set(&timeRtems);
switch (status) {
case RTEMS_SUCCESSFUL:

View File

@ -5,8 +5,8 @@
#ifdef _WIN32
#include <windows.h>
#include <processthreadsapi.h>
#include <windows.h>
namespace tasks {

View File

@ -14,7 +14,6 @@
#include <ctime>
#endif
class Clock {
public:
// https://xkcd.com/927/

View File

@ -1,5 +1,5 @@
#include <ctime>
#include <cstdlib>
#include <ctime>
#include "fsfw/ipc/MutexGuard.h"
#include "fsfw/timemanager/Clock.h"

View File

@ -38,6 +38,4 @@ uint32_t Countdown::getRemainingMillis() const {
}
}
uint32_t Countdown::getCurrentTime() const {
return Clock::getUptime_ms();
}
uint32_t Countdown::getCurrentTime() const { return Clock::getUptime_ms(); }

View File

@ -1,17 +1,17 @@
#ifndef FSFW_TIMEMANAGER_TIMEREADERIF_H
#define FSFW_TIMEMANAGER_TIMEREADERIF_H
#include <cstdio>
#include <cstdlib>
#include <sys/time.h>
#include <cstdio>
#include <cstdlib>
#include "fsfw/platform.h"
#ifdef PLATFORM_WIN
// wtf? Required for timeval!
#include <winsock2.h>
#include <winsock.h>
#include <winsock2.h>
#endif
#include "TimeStampIF.h"

View File

@ -15,7 +15,8 @@ class HostFilesystem : public HasFileSystemIF {
ReturnValue_t readFromFile(FileOpParams fileOpInfo, uint8_t **buffer, size_t &readSize,
size_t maxSize) override;
ReturnValue_t createFile(FilesystemParams params, const uint8_t *data, size_t size) override;
ReturnValue_t removeFile(const std::filesystem::path::value_type *path, FileSystemArgsIF *args) override;
ReturnValue_t removeFile(const std::filesystem::path::value_type *path,
FileSystemArgsIF *args) override;
ReturnValue_t createDirectory(FilesystemParams params, bool createParentDirs) override;
ReturnValue_t removeDirectory(FilesystemParams params, bool deleteRecurively) override;
ReturnValue_t rename(const std::filesystem::path::value_type *oldPath,

View File

@ -20,9 +20,9 @@ add_subdirectory(globalfunctions)
add_subdirectory(timemanager)
add_subdirectory(tmtcpacket)
add_subdirectory(cfdp)
IF(NOT FSFW_OSAL MATCHES "rtems")
if(NOT FSFW_OSAL MATCHES "rtems")
add_subdirectory(hal)
ENDIF()
endif()
add_subdirectory(internalerror)
add_subdirectory(devicehandler)
add_subdirectory(tmtcservices)

View File

@ -57,8 +57,7 @@ void exit_qemu_failing(int error) {
/* Exit status code. Host QEMU process exits with that status. */
asm("mov x0, %[error]\n\t" : : [error] "r"(error));
asm(
"str x0, [sp,#8]\n\t"
asm("str x0, [sp,#8]\n\t"
/* x1 contains the address of parameter block.
* Any memory address could be used. */
@ -68,8 +67,7 @@ void exit_qemu_failing(int error) {
"mov w0, #0x18\n\t"
/* Do the semihosting call on A64. */
"hlt 0xf000\n\t"
);
"hlt 0xf000\n\t");
}
#include <rtemsConfig.h>

View File

@ -157,8 +157,8 @@ TEST_CASE("DataSetTest", "[DataSetTest]") {
CHECK(maxSize == sizeof(uint8_t) + sizeof(uint16_t) * 3 + sizeof(float) + 1);
serSize = 0;
buffPtr = buffer.data();
CHECK(localSet.serialize(&buffPtr, &serSize, buffer.size(), SerializeIF::Endianness::MACHINE) ==
returnvalue::OK);
CHECK(localSet.serialize(&buffPtr, &serSize, buffer.size(),
SerializeIF::Endianness::MACHINE) == returnvalue::OK);
CHECK(rawUint8 == 232);
std::memcpy(&rawFloat, buffer.data() + sizeof(uint8_t), sizeof(float));
CHECK(rawFloat == Catch::Approx(-2324.322));
@ -205,8 +205,8 @@ TEST_CASE("DataSetTest", "[DataSetTest]") {
/* Common fault test cases */
// LocalPoolObjectBase* variableHandle = poolOwner.getPoolObjectHandle(lpool::uint32VarId);
// CHECK(variableHandle != nullptr);
//CHECK(localSet.registerVariable(variableHandle) == static_cast<int>(DataSetIF::DATA_SET_FULL));
//variableHandle = nullptr;
// CHECK(localSet.registerVariable(variableHandle) ==
// static_cast<int>(DataSetIF::DATA_SET_FULL)); variableHandle = nullptr;
// REQUIRE(localSet.registerVariable(variableHandle) ==
// static_cast<int>(DataSetIF::POOL_VAR_NULL));
}

View File

@ -1,10 +1,10 @@
#include <etl/crc32.h>
#include <array>
#include <catch2/catch_test_macros.hpp>
#include <filesystem>
#include <fstream>
#include <random>
#include <array>
#include "fsfw/serialize/SerializeIF.h"
#include "fsfw_hal/host/HostFilesystem.h"

View File

@ -5,9 +5,9 @@
#include "fsfw/serialize/SerializeIF.h"
ReturnValue_t FilesystemMock::feedFile(const std::string &filename, std::ifstream &file) {
// not multibyte encoding safe!
std::basic_string<std::filesystem::path::value_type> native_filename(filename.begin(), filename.end());
std::basic_string<std::filesystem::path::value_type> native_filename(filename.begin(),
filename.end());
if (not std::filesystem::exists(native_filename)) {
return returnvalue::FAILED;

View File

@ -20,7 +20,8 @@
class FilesystemMock : public HasFileSystemIF {
public:
struct FileWriteInfo {
FileWriteInfo(std::basic_string<std::filesystem::path::value_type> filename, size_t offset, const uint8_t *data, size_t len)
FileWriteInfo(std::basic_string<std::filesystem::path::value_type> filename, size_t offset,
const uint8_t *data, size_t len)
: offset(offset) {
this->filename = filename;
this->data.insert(this->data.end(), data, data + len);
@ -56,8 +57,7 @@ class FilesystemMock : public HasFileSystemIF {
};
std::queue<RenameInfo> renameQueue;
std::basic_string<std::filesystem::path::value_type> truncateCalledOnFile;
ReturnValue_t feedFile(const std::string &filename,
std::ifstream &file);
ReturnValue_t feedFile(const std::string &filename, std::ifstream &file);
bool fileExists(FilesystemParams params) override;
ReturnValue_t truncateFile(FilesystemParams params) override;

View File

@ -4,7 +4,6 @@
#include <catch2/catch_test_macros.hpp>
TEST_CASE("Binary Semaphore Test", "[BinSemaphore]") {
// perform set-up here
SemaphoreIF* binSemaph = SemaphoreFactory::instance()->createBinarySemaphore();

View File

@ -1,8 +1,7 @@
#pragma once
#include <rtems/extension.h>
#include <rtems/bspIo.h>
#include <rtems/extension.h>
void user_handle_fatal(Internal_errors_Source source, bool internal, Internal_errors_t error_code);
#define RTEMS_USE_UNLIMITED_OBJECTS_ALLOCATION 0
@ -24,7 +23,8 @@ void user_handle_fatal(Internal_errors_Source source, bool internal, Internal_e
//! Around 41 kB extra task stack for now.
#define CONFIGURE_EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_INITIAL_EXTENSIONS { NULL, NULL, NULL, NULL, NULL, NULL, NULL, user_handle_fatal, NULL }
#define CONFIGURE_INITIAL_EXTENSIONS \
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, user_handle_fatal, NULL }
#define CONFIGURE_INIT