auto format
This commit is contained in:
parent
0329d32b49
commit
0e7c5a931b
@ -4,10 +4,8 @@
|
|||||||
#include "fsfw/events/eventmatching/ReporterRangeMatcher.h"
|
#include "fsfw/events/eventmatching/ReporterRangeMatcher.h"
|
||||||
#include "fsfw/events/eventmatching/SeverityRangeMatcher.h"
|
#include "fsfw/events/eventmatching/SeverityRangeMatcher.h"
|
||||||
|
|
||||||
|
|
||||||
EventMatchTree::EventMatchTree(StorageManagerIF* storageBackend, bool invertedMatch)
|
EventMatchTree::EventMatchTree(StorageManagerIF* storageBackend, bool invertedMatch)
|
||||||
: MatchTree<EventMessage*>(end(), 1), factory(storageBackend), invertedMatch(invertedMatch) {
|
: MatchTree<EventMessage*>(end(), 1), factory(storageBackend), invertedMatch(invertedMatch) {}
|
||||||
}
|
|
||||||
|
|
||||||
EventMatchTree::~EventMatchTree() {}
|
EventMatchTree::~EventMatchTree() {}
|
||||||
|
|
||||||
|
@ -24,9 +24,7 @@ class MatchTree : public SerializeableMatcherIF<T>, public BinaryTree<Serializea
|
|||||||
MatchTree(iterator root, uint8_t maxDepth = -1)
|
MatchTree(iterator root, uint8_t maxDepth = -1)
|
||||||
: BinaryTree<SerializeableMatcherIF<T>>(root.element), maxDepth(maxDepth) {}
|
: BinaryTree<SerializeableMatcherIF<T>>(root.element), maxDepth(maxDepth) {}
|
||||||
MatchTree() : BinaryTree<SerializeableMatcherIF<T>>(), maxDepth(-1) {}
|
MatchTree() : BinaryTree<SerializeableMatcherIF<T>>(), maxDepth(-1) {}
|
||||||
virtual ~MatchTree() {
|
virtual ~MatchTree() { clear(); }
|
||||||
clear();
|
|
||||||
}
|
|
||||||
virtual bool match(T number) override { return matchesTree(number); }
|
virtual bool match(T number) override { return matchesTree(number); }
|
||||||
bool matchesTree(T number) {
|
bool matchesTree(T number) {
|
||||||
iterator iter = this->begin();
|
iterator iter = this->begin();
|
||||||
|
@ -14,8 +14,7 @@ void HealthTable::setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t tim
|
|||||||
this->mutexTimeoutMs = timeoutMs;
|
this->mutexTimeoutMs = timeoutMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
HealthTable::~HealthTable() {
|
HealthTable::~HealthTable() { MutexFactory::instance()->deleteMutex(mutex); }
|
||||||
MutexFactory::instance()->deleteMutex(mutex); }
|
|
||||||
|
|
||||||
ReturnValue_t HealthTable::registerObject(object_id_t object,
|
ReturnValue_t HealthTable::registerObject(object_id_t object,
|
||||||
HasHealthIF::HealthState initilialState) {
|
HasHealthIF::HealthState initilialState) {
|
||||||
|
@ -1,32 +1,28 @@
|
|||||||
#include <catch2/catch_test_macros.hpp>
|
#include <fsfw/osal/osal.h>
|
||||||
|
|
||||||
#include <fsfw/tasks/SemaphoreFactory.h>
|
#include <fsfw/tasks/SemaphoreFactory.h>
|
||||||
#include <fsfw/timemanager/Stopwatch.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
|
#ifdef FSFW_OSAL_LINUX
|
||||||
|
|
||||||
TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") {
|
TEST_CASE("Binary Semaphore Test", "[BinSemaphore]") {
|
||||||
//perform set-up here
|
// perform set-up here
|
||||||
SemaphoreIF* binSemaph = SemaphoreFactory::instance()->
|
SemaphoreIF* binSemaph = SemaphoreFactory::instance()->createBinarySemaphore();
|
||||||
createBinarySemaphore();
|
|
||||||
REQUIRE(binSemaph != nullptr);
|
REQUIRE(binSemaph != nullptr);
|
||||||
SECTION("Simple Test") {
|
SECTION("Simple Test") {
|
||||||
// set-up is run for each section
|
// set-up is run for each section
|
||||||
REQUIRE(binSemaph->getSemaphoreCounter() == 1);
|
REQUIRE(binSemaph->getSemaphoreCounter() == 1);
|
||||||
REQUIRE(binSemaph->release() ==
|
REQUIRE(binSemaph->release() == static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
|
||||||
static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
|
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) == returnvalue::OK);
|
||||||
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) ==
|
|
||||||
returnvalue::OK);
|
|
||||||
{
|
{
|
||||||
// not precise enough on linux.. should use clock instead..
|
// not precise enough on linux.. should use clock instead..
|
||||||
//Stopwatch stopwatch(false);
|
// Stopwatch stopwatch(false);
|
||||||
//REQUIRE(binSemaph->acquire(SemaphoreIF::TimeoutType::WAITING, 5) ==
|
// REQUIRE(binSemaph->acquire(SemaphoreIF::TimeoutType::WAITING, 5) ==
|
||||||
// SemaphoreIF::SEMAPHORE_TIMEOUT);
|
// SemaphoreIF::SEMAPHORE_TIMEOUT);
|
||||||
//dur_millis_t time = stopwatch.stop();
|
// dur_millis_t time = stopwatch.stop();
|
||||||
//CHECK(time == 5);
|
// CHECK(time == 5);
|
||||||
}
|
}
|
||||||
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
|
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
|
||||||
REQUIRE(binSemaph->release() == returnvalue::OK);
|
REQUIRE(binSemaph->release() == returnvalue::OK);
|
||||||
@ -35,11 +31,8 @@ TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") {
|
|||||||
// perform tear-down here
|
// perform tear-down here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Counting Semaphore Test", "[CountingSemaph]") {
|
||||||
TEST_CASE("Counting Semaphore Test" , "[CountingSemaph]") {
|
SECTION("Simple Test") {}
|
||||||
SECTION("Simple Test") {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user