taken over unnittest folder from upstream

This commit is contained in:
2020-12-13 21:58:54 +01:00
parent 0b056720ba
commit 7c390c07ee
26 changed files with 376 additions and 292 deletions

View File

@ -2,7 +2,7 @@
#define FRAMEWORK_TEST_UNITTESTCLASS_H_
#include "UnittDefinitions.h"
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include "../../returnvalues/HasReturnvaluesIF.h"
/**
* @brief Can be used for internal testing, for example for hardware specific

View File

@ -1,4 +1,4 @@
#include <fsfw/unittest/internal/UnittDefinitions.h>
#include "UnittDefinitions.h"
ReturnValue_t unitt::put_error(std::string errorId) {
sif::error << "Unit Tester error: Failed at test ID "

View File

@ -1,7 +1,8 @@
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/unittest/internal/osal/IntTestMq.h>
#include <fsfw/unittest/internal/UnittDefinitions.h>
#include "IntTestMq.h"
#include "../UnittDefinitions.h"
#include "../../ipc/MessageQueueIF.h"
#include "../../ipc/QueueFactory.h"
#include <array>

View File

@ -1,10 +1,10 @@
#include "IntTestMutex.h"
#include <fsfw/ipc/MutexFactory.h>
#include <unittest/internal/UnittDefinitions.h>
#include "../../ipc/MutexFactory.h"
#include "../UnittDefinitions.h"
#if defined(hosted)
#include <fsfw/osal/hosted/Mutex.h>
#include "../../osal/hosted/Mutex.h"
#include <thread>
#include <future>
#endif
@ -20,7 +20,7 @@ void testmutex::testMutex() {
// timed_mutex from the C++ library specifies undefined behaviour if
// the timed mutex is locked twice from the same thread.
#if defined(hosted)
// hold on, this actually worked ? :-D This calls the function from
// This calls the function from
// another thread and stores the returnvalue in a future.
auto future = std::async(&MutexIF::lockMutex, mutex, 1);
result = future.get();

View File

@ -1,8 +1,9 @@
#include "IntTestSemaphore.h"
#include <fsfw/tasks/SemaphoreFactory.h>
#include <unittest/internal/UnittDefinitions.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/timemanager/Stopwatch.h>
#include "../UnittDefinitions.h"
#include "../../tasks/SemaphoreFactory.h"
#include "../../serviceinterface/ServiceInterfaceStream.h"
#include "../../timemanager/Stopwatch.h"
void testsemaph::testBinSemaph() {

View File

@ -1,8 +1,9 @@
#include "IntTestSerialization.h"
#include <fsfw/serialize/SerializeElement.h>
#include <fsfw/serialize/SerialBufferAdapter.h>
#include <unittest/internal/UnittDefinitions.h>
#include <fsfw/serialize/SerializeIF.h>
#include "../UnittDefinitions.h"
#include "../../serialize/SerializeElement.h"
#include "../../serialize/SerialBufferAdapter.h"
#include "../../serialize/SerializeIF.h"
#include <array>
using retval = HasReturnvaluesIF;

View File

@ -1,6 +1,7 @@
#ifndef UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
#define UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#ifndef FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
#define FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_
#include "../../returnvalues/HasReturnvaluesIF.h"
#include <array>
namespace testserialize {
@ -12,4 +13,4 @@ ReturnValue_t test_serial_buffer_adapter();
extern std::array<uint8_t, 512> test_array;
}
#endif /* UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_ */
#endif /* FSFW_UNITTEST_INTERNAL_INTTESTSERIALIZATION_H_ */