Skip to content

Commit 911d628

Browse files
committed
[#24281] Fixed 'timestamp_to_string_format' test
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent 771b137 commit 911d628

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

cpp_utils/src/cpp/time/time_utils.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ Timestamp string_to_timestamp(
178178
if (ss.fail())
179179
{
180180
throw PreconditionNotMet(
181-
STR_ENTRY << "Format <" << format << "> to convert string to Timestamp is not valid for timestamp " << timestamp <<
182-
".");
181+
STR_ENTRY << "Format <" << format << "> to convert string to Timestamp is not valid for timestamp "
182+
<< timestamp << ".");
183183
}
184184

185185
std::time_t utc_time;
@@ -238,8 +238,9 @@ time_t normalize(
238238
if (0 > time || time > max_value)
239239
{
240240
EPROSIMA_LOG_WARNING(TIME_UTILS,
241-
"Timestamp value: " << time << " is out of range for Windows, clamping to 0 and " <<
242-
max_value);
241+
"Timestamp value: "
242+
<< time << " is out of range for Windows, clamping to 0 and "
243+
<< max_value);
243244
normalized_time = std::max((time_t) 0, std::min(max_value, time));
244245
}
245246
#endif // if _EPROSIMA_WINDOWS_PLATFORM

cpp_utils/test/unittest/time/time_utils_test.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,7 @@ TEST(time_utils_test, timestamp_to_string_format)
377377
// time zone
378378
{
379379
// String for Time Zone is different in Windows or Linux
380-
#if _EPROSIMA_WINDOWS_PLATFORM
381-
std::string expected_str = "Coordinated Universal Time";
382-
#else
383-
std::string expected_str = "GMT";
384-
#endif // _EPROSIMA_WINDOWS_PLATFORM
380+
std::string expected_str = "UTC+00";
385381

386382
std::string date_str = timestamp_to_string(date, "%Z");
387383
ASSERT_EQ(date_str, expected_str);

0 commit comments

Comments
 (0)