Skip to content

Commit

Permalink
[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 5ce5c5d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 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,21 @@ 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 5ce5c5d

Please sign in to comment.