From fe80913148978f16295843e9aacd35705eb9b235 Mon Sep 17 00:00:00 2001 From: Quinn Pfeifer <72775766+QuinnP2910@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:32:15 -0800 Subject: [PATCH] Make scan output check less verbose --- src/Rover.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Rover.cpp b/src/Rover.cpp index 47b5e999..a278056b 100644 --- a/src/Rover.cpp +++ b/src/Rover.cpp @@ -128,16 +128,11 @@ void parseCommandLine(int argc, char** argv) { // Extract components from the date string int year, month, day, hour, minute, second; - sscanf(dateString.c_str(), "%4d%2d%2d_%2d%2d%2d", &year, &month, &day, - &hour, &minute, &second); - - // Ensure scan outputs are correct - CHECK_EQ_F(std::stoi(dateString.substr(0, 4)), year); - CHECK_EQ_F(std::stoi(dateString.substr(4, 2)), month); - CHECK_EQ_F(std::stoi(dateString.substr(6, 2)), day); - CHECK_EQ_F(std::stoi(dateString.substr(9, 2)), hour); - CHECK_EQ_F(std::stoi(dateString.substr(11, 2)), minute); - CHECK_EQ_F(std::stoi(dateString.substr(13, 2)), second); + int scan_count = sscanf(dateString.c_str(), "%4d%2d%2d_%2d%2d%2d", &year, + &month, &day, &hour, &minute, &second); + + // Ensure scan output count is 6 + CHECK_EQ_F(scan_count, 6); // Create a tm structure std::tm tm_struct = {};