mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
ctest: Fix STOP_TIME for vendored archive_parse_date from libarchive 3.8.8+
libarchive commit `422aae80ae` (Date parsing: reject date components with numbers of more than 4 digits, 2026-05-07), backported to version 3.8.8 by libarchive commit `8cf7393f98` (Merge pull request `#3010`..., 2026-05-07, `v3.8.8~142`), disallows our non-standard hyphen-free date format. Convert to a standard format.
This commit is contained in:
+1
-1
@@ -2864,7 +2864,7 @@ void cmCTest::SetStopTime(std::string const& time_str)
|
||||
|
||||
tzone_offset *= 100;
|
||||
char buf[1024];
|
||||
snprintf(buf, sizeof(buf), "%d%02d%02d %s %+05i", lctime->tm_year + 1900,
|
||||
snprintf(buf, sizeof(buf), "%d-%02d-%02d %s %+05i", lctime->tm_year + 1900,
|
||||
lctime->tm_mon + 1, lctime->tm_mday, time_str.c_str(),
|
||||
tzone_offset);
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ bool parse_date()
|
||||
std::time_t now;
|
||||
std::time(&now);
|
||||
{
|
||||
std::time_t t = cm_parse_date(now, "20000101 00:01:02 -0000");
|
||||
std::time_t t = cm_parse_date(now, "2000-01-01 00:01:02 -0000");
|
||||
ASSERT_EQUAL(t, 946684862);
|
||||
}
|
||||
{
|
||||
std::time_t t = cm_parse_date(now, "20380601 00:01:02 -0000");
|
||||
std::time_t t = cm_parse_date(now, "2038-06-01 00:01:02 -0000");
|
||||
ASSERT_EQUAL(t, sizeof(time_t) <= 4 ? -1 : 2158963262);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user