Merge branch 'develop' into eive/develop
This commit is contained in:
@ -18,4 +18,5 @@ add_subdirectory(serialize)
|
||||
add_subdirectory(datapoollocal)
|
||||
add_subdirectory(storagemanager)
|
||||
add_subdirectory(globalfunctions)
|
||||
add_subdirectory(timemanager)
|
||||
add_subdirectory(tmtcpacket)
|
||||
|
@ -103,7 +103,7 @@ TEST_CASE("DleEncoder" , "[DleEncoder]") {
|
||||
for(size_t faultyDestSize = 0; faultyDestSize < expectedVec.size(); faultyDestSize ++) {
|
||||
result = dleEncoder.encode(vecToEncode.data(), vecToEncode.size(),
|
||||
buffer.data(), faultyDestSize, &encodedLen);
|
||||
REQUIRE(result == DleEncoder::STREAM_TOO_SHORT);
|
||||
REQUIRE(result == static_cast<int>(DleEncoder::STREAM_TOO_SHORT));
|
||||
}
|
||||
};
|
||||
|
||||
@ -218,5 +218,10 @@ TEST_CASE("DleEncoder" , "[DleEncoder]") {
|
||||
REQUIRE(result == static_cast<int>(DleEncoder::DECODING_ERROR));
|
||||
|
||||
dleEncoder.setEscapeMode(true);
|
||||
testArray1EncodedFaulty = TEST_ARRAY_1_ENCODED_ESCAPED;
|
||||
testArray1EncodedFaulty[5] = 0;
|
||||
result = dleEncoder.decode(testArray1EncodedFaulty.data(), testArray1EncodedFaulty.size(),
|
||||
&readLen, buffer.data(), buffer.size(), &encodedLen);
|
||||
REQUIRE(result == static_cast<int>(DleEncoder::DECODING_ERROR));
|
||||
}
|
||||
}
|
||||
|
3
tests/src/fsfw_tests/unit/timemanager/CMakeLists.txt
Normal file
3
tests/src/fsfw_tests/unit/timemanager/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
TestCountdown.cpp
|
||||
)
|
27
tests/src/fsfw_tests/unit/timemanager/TestCountdown.cpp
Normal file
27
tests/src/fsfw_tests/unit/timemanager/TestCountdown.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include "fsfw_tests/unit/CatchDefinitions.h"
|
||||
#include <fsfw/timemanager/Countdown.h>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
|
||||
TEST_CASE( "Countdown Tests", "[TestCountdown]") {
|
||||
INFO("Countdown Tests");
|
||||
Countdown count(20);
|
||||
REQUIRE(count.timeout == 20);
|
||||
REQUIRE(count.setTimeout(100) == static_cast<uint16_t>(HasReturnvaluesIF::RETURN_OK));
|
||||
REQUIRE(count.timeout == 100);
|
||||
REQUIRE(count.setTimeout(150) == static_cast<uint16_t>(HasReturnvaluesIF::RETURN_OK));
|
||||
REQUIRE(count.isBusy());
|
||||
REQUIRE(not count.hasTimedOut());
|
||||
uint32_t number = count.getRemainingMillis();
|
||||
REQUIRE(number > 0);
|
||||
bool blocked = false;
|
||||
while(not count.hasTimedOut()){
|
||||
blocked = true;
|
||||
};
|
||||
REQUIRE(blocked);
|
||||
number = count.getRemainingMillis();
|
||||
REQUIRE(number==0);
|
||||
count.resetTimer();
|
||||
REQUIRE(not count.hasTimedOut());
|
||||
REQUIRE(count.isBusy());
|
||||
}
|
Reference in New Issue
Block a user