auto format

This commit is contained in:
Ulrich Mohr 2023-01-12 14:14:58 +01:00
parent 0329d32b49
commit 0e7c5a931b
5 changed files with 31 additions and 43 deletions

View File

@ -4,10 +4,8 @@
#include "fsfw/events/eventmatching/ReporterRangeMatcher.h"
#include "fsfw/events/eventmatching/SeverityRangeMatcher.h"
EventMatchTree::EventMatchTree(StorageManagerIF* storageBackend, bool invertedMatch)
: MatchTree<EventMessage*>(end(), 1), factory(storageBackend), invertedMatch(invertedMatch) {
}
: MatchTree<EventMessage*>(end(), 1), factory(storageBackend), invertedMatch(invertedMatch) {}
EventMatchTree::~EventMatchTree() {}

View File

@ -24,9 +24,7 @@ class MatchTree : public SerializeableMatcherIF<T>, public BinaryTree<Serializea
MatchTree(iterator root, uint8_t maxDepth = -1)
: BinaryTree<SerializeableMatcherIF<T>>(root.element), maxDepth(maxDepth) {}
MatchTree() : BinaryTree<SerializeableMatcherIF<T>>(), maxDepth(-1) {}
virtual ~MatchTree() {
clear();
}
virtual ~MatchTree() { clear(); }
virtual bool match(T number) override { return matchesTree(number); }
bool matchesTree(T number) {
iterator iter = this->begin();

View File

@ -14,8 +14,7 @@ void HealthTable::setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t tim
this->mutexTimeoutMs = timeoutMs;
}
HealthTable::~HealthTable() {
MutexFactory::instance()->deleteMutex(mutex); }
HealthTable::~HealthTable() { MutexFactory::instance()->deleteMutex(mutex); }
ReturnValue_t HealthTable::registerObject(object_id_t object,
HasHealthIF::HealthState initilialState) {

View File

@ -32,7 +32,7 @@ class ObjectManager : public ObjectManagerIF {
/**
* Deletes the single instance of ObjectManager
*/
*/
static void clear();
void setObjectFactoryFunction(produce_function_t prodFunc, void* args);

View File

@ -1,45 +1,38 @@
#include <catch2/catch_test_macros.hpp>
#include <fsfw/osal/osal.h>
#include <fsfw/tasks/SemaphoreFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <fsfw/osal/osal.h>
#include <catch2/catch_test_macros.hpp>
//binary semaphores currently only supported on linux
// binary semaphores currently only supported on linux
#ifdef FSFW_OSAL_LINUX
TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") {
//perform set-up here
SemaphoreIF* binSemaph = SemaphoreFactory::instance()->
createBinarySemaphore();
REQUIRE(binSemaph != nullptr);
SECTION("Simple Test") {
// set-up is run for each section
REQUIRE(binSemaph->getSemaphoreCounter() == 1);
REQUIRE(binSemaph->release() ==
static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) ==
returnvalue::OK);
{
// not precise enough on linux.. should use clock instead..
//Stopwatch stopwatch(false);
//REQUIRE(binSemaph->acquire(SemaphoreIF::TimeoutType::WAITING, 5) ==
// SemaphoreIF::SEMAPHORE_TIMEOUT);
//dur_millis_t time = stopwatch.stop();
//CHECK(time == 5);
}
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
REQUIRE(binSemaph->release() == returnvalue::OK);
}
SemaphoreFactory::instance()->deleteSemaphore(binSemaph);
// perform tear-down here
TEST_CASE("Binary Semaphore Test", "[BinSemaphore]") {
// perform set-up here
SemaphoreIF* binSemaph = SemaphoreFactory::instance()->createBinarySemaphore();
REQUIRE(binSemaph != nullptr);
SECTION("Simple Test") {
// set-up is run for each section
REQUIRE(binSemaph->getSemaphoreCounter() == 1);
REQUIRE(binSemaph->release() == static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) == returnvalue::OK);
{
// not precise enough on linux.. should use clock instead..
// Stopwatch stopwatch(false);
// REQUIRE(binSemaph->acquire(SemaphoreIF::TimeoutType::WAITING, 5) ==
// SemaphoreIF::SEMAPHORE_TIMEOUT);
// dur_millis_t time = stopwatch.stop();
// CHECK(time == 5);
}
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
REQUIRE(binSemaph->release() == returnvalue::OK);
}
SemaphoreFactory::instance()->deleteSemaphore(binSemaph);
// perform tear-down here
}
TEST_CASE("Counting Semaphore Test" , "[CountingSemaph]") {
SECTION("Simple Test") {
}
TEST_CASE("Counting Semaphore Test", "[CountingSemaph]") {
SECTION("Simple Test") {}
}
#endif