On 16/02/2026 07:22, Bruno Haible wrote:
Hi Pádraig,

The new unit test fails on 32-bit Cygwin and on native Windows:

../../gltests/test-parse-datetime.c:280: assertion 'parse_datetime (&result, p, 
NULL)' failed
../../gltests/test-parse-datetime.c:283: assertion 'parse_datetime (&result2, 
p, NULL)' failed
../../gltests/test-parse-datetime.c:285: assertion 'result.tv_sec == 
result2.tv_sec' failed
FAIL test-parse-datetime.exe (exit status: 1)

Bruno

Oh right. Year 0003 is not supported there.
I pushed the attached which should hopefully address it.

thanks,
Padraig
From cfdf3467ac463a1c3e099f08086c79ecf82702b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Mon, 16 Feb 2026 11:21:57 +0000
Subject: [PATCH] parse-datetime: avoid false test failure on windows

* tests/test-parse-datetime.c: Tweak so that year 2003 rather than 0003
is used, as the latter is not supported by mktime on Windows or Cygwin.
Reported by Bruno Haible.
---
 ChangeLog                   | 7 +++++++
 tests/test-parse-datetime.c | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1bde9e09aa..8a8dcf878e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-02-16  Pádraig Brady  <[email protected]>
+
+	parse-datetime: avoid false test failure on windows
+	* tests/test-parse-datetime.c: Tweak so that year 2003 rather than 0003
+	is used, as the latter is not supported by mktime on Windows or Cygwin.
+	Reported by Bruno Haible.
+
 2026-02-16  Bruno Haible  <[email protected]>
 
 	HACKING: Add an LLM policy.
diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c
index 61cf5502c7..a4b9fb0643 100644
--- a/tests/test-parse-datetime.c
+++ b/tests/test-parse-datetime.c
@@ -276,10 +276,10 @@ main (_GL_UNUSED int argc, char **argv)
   ASSERT (result.tv_nsec == 0);
 
   /* DD.MM.YY MM/DD/YY equivalence */
-  p = "2.1.3 day";
+  p = "2.1.03 day";
   ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, now, result);
-  p = "1/2/3 day";
+  p = "1/2/03 day";
   ASSERT (parse_datetime (&result2, p, NULL));
   LOG (p, now, result2);
   ASSERT (result.tv_sec == result2.tv_sec);
-- 
2.52.0

Reply via email to