From 5ce5c5df9dd87848fc912f011bed724202d58377 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 2 Nov 2024 15:29:20 +1100 Subject: [PATCH] [C++] skip `-0117` in StrptimeZoneOffset for old glibc --- cpp/src/arrow/util/value_parsing_test.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/util/value_parsing_test.cc b/cpp/src/arrow/util/value_parsing_test.cc index 7cd1ab1e25c31..d55c7c9496f92 100644 --- a/cpp/src/arrow/util/value_parsing_test.cc +++ b/cpp/src/arrow/util/value_parsing_test.cc @@ -838,12 +838,21 @@ TEST(TimestampParser, StrptimeZoneOffset) { std::string format = "%Y-%d-%m %H:%M:%S%z"; auto parser = TimestampParser::MakeStrptime(format); + std::vector values = { + "2018-01-01 00:00:00+0000", + "2018-01-01 00:00:00+0100", +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ >= 2) && \ + (__GLIBC_MINOR__ >= 28) + // see https://github.com/apache/arrow/issues/43808 + "2018-01-01 00:00:00-0117", +#endif + "2018-01-01 00:00:00+0130" + }; + // N.B. GNU %z supports ISO8601 format while BSD %z supports only // +HHMM or -HHMM and POSIX doesn't appear to define %z at all for (auto unit : TimeUnit::values()) { - for (const std::string value : - {"2018-01-01 00:00:00+0000", "2018-01-01 00:00:00+0100", - "2018-01-01 00:00:00+0130", "2018-01-01 00:00:00-0117"}) { + for (const std::string value : values) { SCOPED_TRACE(value); int64_t converted = 0; int64_t expected = 0;