Skip to content

Commit

Permalink
apacheGH-43808: [C++] skip -0117 in StrptimeZoneOffset for old glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Nov 7, 2024
1 parent 9b27f42 commit a3f3105
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cpp/src/arrow/util/value_parsing_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,19 @@ TEST(TimestampParser, StrptimeZoneOffset) {
std::string format = "%Y-%d-%m %H:%M:%S%z";
auto parser = TimestampParser::MakeStrptime(format);

std::vector<std::string> 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;
Expand Down

0 comments on commit a3f3105

Please sign in to comment.