mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-16 16:28:09 +08:00
test: stop using std::gmtime in tests
This commit is contained in:
@@ -965,9 +965,7 @@ TEST_CASE("testing toml::find offset_datetime")
|
|||||||
const auto timet = std::chrono::system_clock::to_time_t(date);
|
const auto timet = std::chrono::system_clock::to_time_t(date);
|
||||||
|
|
||||||
// get time_t as gmtime (2018-04-01T03:30:00Z)
|
// get time_t as gmtime (2018-04-01T03:30:00Z)
|
||||||
const auto tmp = std::gmtime(std::addressof(timet)); // XXX not threadsafe!
|
const auto tm = toml::detail::gmtime_s(std::addressof(timet));
|
||||||
CHECK_UNARY(tmp);
|
|
||||||
const auto tm = *tmp;
|
|
||||||
CHECK_EQ(tm.tm_year + 1900, 2018);
|
CHECK_EQ(tm.tm_year + 1900, 2018);
|
||||||
CHECK_EQ(tm.tm_mon + 1, 4);
|
CHECK_EQ(tm.tm_mon + 1, 4);
|
||||||
CHECK_EQ(tm.tm_mday, 1);
|
CHECK_EQ(tm.tm_mday, 1);
|
||||||
|
Reference in New Issue
Block a user