test stamp in filename
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -4,5 +4,6 @@ add_subdirectory(mocks)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
main.cpp
|
||||
testEnvironment.cpp
|
||||
testStampInFilename.cpp
|
||||
printChar.cpp
|
||||
)
|
18
unittest/testStampInFilename.cpp
Normal file
18
unittest/testStampInFilename.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <cinttypes>
|
||||
|
||||
#include "fsfw/timemanager/Clock.h"
|
||||
|
||||
TEST_CASE("Stamp in Filename", "[Stamp In Filename]") {
|
||||
Clock::TimeOfDay_t tod;
|
||||
std::string baseName = "verif";
|
||||
std::string pathStr = "verif_2022-05-25T16:55:23Z.bin";
|
||||
float seconds = 0.0;
|
||||
char* prefix = nullptr;
|
||||
int count =
|
||||
sscanf(pathStr.c_str(),
|
||||
"%s_%4" SCNu32 "-%2" SCNu32 "-%2" SCNu32 "T%2" SCNu32 ":%2" SCNu32 ":%2" SCNu32 "Z",
|
||||
prefix, &tod.year, &tod.month, &tod.day, &tod.hour, &tod.minute, &tod.second);
|
||||
static_cast<void>(count);
|
||||
}
|
Reference in New Issue
Block a user