apply clang format to unittest folder as well
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
be122038ed
commit
9e03f9babe
@ -10,3 +10,5 @@ find ./bsp_linux_board -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-fo
|
||||
find ./bsp_hosted -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
||||
find ./bsp_egse -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
||||
find ./test -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
|
||||
find ./unittest -iname *.h -o -iname *.cpp -o -iname *.c -o -type d -name build -prune | \
|
||||
xargs clang-format --style=file -i
|
||||
|
@ -4,4 +4,3 @@
|
||||
int main(int argc, char* argv[]) {
|
||||
// fsfwtest::customMain(argc, argv);
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,15 @@
|
||||
#include "conf.h"
|
||||
#include "HasActionsIF.h"
|
||||
#include "CoreController.h"
|
||||
#include "SdCardManager.h"
|
||||
#include "event.h"
|
||||
#include "libxiphos.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "HasActionsIF.h"
|
||||
#include "SdCardManager.h"
|
||||
#include "conf.h"
|
||||
#include "event.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "libxiphos.h"
|
||||
|
||||
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
@ -436,8 +437,8 @@ void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
<< "\nimg00lock: " << file.img00Lock << "\nimg01lock: " << file.img01Lock
|
||||
<< "\nimg10lock: " << file.img10Lock << "\nimg11lock: " << file.img11Lock
|
||||
<< "\nbootflag: " << file.bootFlag << "\nlast: " << static_cast<int>(file.lastChip)
|
||||
<< " " << static_cast<int>(file.lastCopy) << "\nnext: "
|
||||
<< static_cast<int>(file.mechanismNextChip) << " "
|
||||
<< " " << static_cast<int>(file.lastCopy)
|
||||
<< "\nnext: " << static_cast<int>(file.mechanismNextChip) << " "
|
||||
<< static_cast<int>(file.mechanismNextCopy) << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "definitions.h"
|
||||
#include "SdCardManager.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "SdCardManager.h"
|
||||
#include "definitions.h"
|
||||
|
||||
namespace xsc {
|
||||
|
||||
enum Chip : int { CHIP_0, CHIP_1, NO_CHIP, SELF_CHIP, ALL_CHIP };
|
||||
@ -14,7 +14,6 @@ enum Copy : int { COPY_0, COPY_1, NO_COPY, SELF_COPY, ALL_COPY };
|
||||
|
||||
} // namespace xsc
|
||||
|
||||
|
||||
struct RebootFile {
|
||||
static constexpr uint8_t DEFAULT_MAX_BOOT_CNT = 10;
|
||||
|
||||
@ -65,6 +64,7 @@ public:
|
||||
void resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy);
|
||||
bool parseRebootFile(std::string path, RebootFile& file);
|
||||
void rewriteRebootFile(RebootFile file);
|
||||
|
||||
private:
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
|
@ -1,9 +1,5 @@
|
||||
#include "SdCardManager.h"
|
||||
|
||||
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) {
|
||||
return "/tmp";
|
||||
}
|
||||
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) { return "/tmp"; }
|
||||
|
||||
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
return true;
|
||||
}
|
||||
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) { return true; }
|
@ -1,4 +1,5 @@
|
||||
#include "event.h"
|
||||
|
||||
#include <queue>
|
||||
|
||||
std::queue<EventInfo> EVENT_QUEUE = {};
|
||||
|
@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "definitions.h"
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
struct EventInfo {
|
||||
// That was just for testing, follow rule of 0
|
||||
/*
|
||||
|
@ -1,9 +1,8 @@
|
||||
#ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
||||
#define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
||||
|
||||
#include "fsfw/FSFW.h"
|
||||
|
||||
#include "ServiceInterfaceBuffer.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "libxiphos.h"
|
||||
|
||||
#include "CoreController.h"
|
||||
|
||||
bool rebootWasCalled = false;
|
||||
@ -19,5 +20,6 @@ void xsc_boot_copy(xsc_libnor_chip_t boot_chip, xsc_libnor_copy_t boot_copy) {
|
||||
rebootWasCalled = true;
|
||||
lastChip = boot_chip;
|
||||
lastCopy = boot_copy;
|
||||
CoreController::setCurrentBootCopy(static_cast<xsc::Chip>(boot_chip), static_cast<xsc::Copy>(boot_copy));
|
||||
CoreController::setCurrentBootCopy(static_cast<xsc::Chip>(boot_chip),
|
||||
static_cast<xsc::Copy>(boot_copy));
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "CoreController.h"
|
||||
#include "libxiphos.h"
|
||||
#include "HasActionsIF.h"
|
||||
#include "event.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include "libxiphos.h"
|
||||
|
||||
static constexpr bool CAT_FILE_TO_CONSOLE = false;
|
||||
const std::string CONF_PATH = "/tmp/conf";
|
||||
@ -57,7 +57,8 @@ TEST_CASE( "Core Controller Reboot File Handling", "[reboot-file]" ) {
|
||||
REQUIRE(rf.lastChip == xsc::CHIP_0);
|
||||
REQUIRE(rf.lastCopy == xsc::COPY_0);
|
||||
uint8_t newRebootCnt = 3;
|
||||
CHECK(ctrl.executeAction(CoreController::SET_MAX_REBOOT_CNT, 0, &newRebootCnt, 1) == HasActionsIF::EXECUTION_FINISHED);
|
||||
CHECK(ctrl.executeAction(CoreController::SET_MAX_REBOOT_CNT, 0, &newRebootCnt, 1) ==
|
||||
HasActionsIF::EXECUTION_FINISHED);
|
||||
ctrl.parseRebootFile(REBOOT_FILE, rf);
|
||||
REQUIRE(rf.enabled == 1);
|
||||
REQUIRE(rf.maxCount == 3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
||||
if (errStream) {
|
||||
|
Loading…
Reference in New Issue
Block a user