diff --git a/src/fsfw/pus/Service11TelecommandScheduling.tpp b/src/fsfw/pus/Service11TelecommandScheduling.tpp index 3cf24b11..c82c1703 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.tpp +++ b/src/fsfw/pus/Service11TelecommandScheduling.tpp @@ -575,11 +575,13 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr return INVALID_TIME_WINDOW; } itBegin = telecommandMap.begin(); - itEnd = telecommandMap.begin(); while (itBegin->first < fromTimestamp && itBegin != telecommandMap.end()) { itBegin++; } + + //start looking for end beginning at begin + itEnd = itBegin; while (itEnd->first <= toTimestamp && itEnd != telecommandMap.end()) { itEnd++; } diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 8c7f2463..d7c35975 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -18,6 +18,7 @@ add_subdirectory(power) add_subdirectory(util) add_subdirectory(container) add_subdirectory(osal) +add_subdirectory(pus) add_subdirectory(serialize) add_subdirectory(datapoollocal) add_subdirectory(storagemanager) diff --git a/unittests/pus/CMakeLists.txt b/unittests/pus/CMakeLists.txt new file mode 100644 index 00000000..ecd7fb49 --- /dev/null +++ b/unittests/pus/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${FSFW_TEST_TGT} PRIVATE + testService11.cpp +) diff --git a/unittests/pus/testService11.cpp b/unittests/pus/testService11.cpp new file mode 100644 index 00000000..72708f09 --- /dev/null +++ b/unittests/pus/testService11.cpp @@ -0,0 +1,14 @@ +#include + +#include + +#include "objects/systemObjectList.h" +#include "tmtc/apid.h" +#include "tmtc/pusIds.h" + +TEST_CASE("PUS Service 11", "[pus-srvc11]") { + Service11TelecommandScheduling<13> pusService11(objects::PUS_SERVICE_11_TC_SCHEDULER, + apid::DEFAULT_APID, pus::PUS_SERVICE_11, nullptr); + + // TODO test something... +} \ No newline at end of file