]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Adjust expected locale-dependent date formats in tests
authorJonathan Wakely <jwakely@redhat.com>
Wed, 10 Apr 2024 12:24:51 +0000 (13:24 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 11 Jun 2024 12:20:45 +0000 (13:20 +0100)
The test 27_io/manipulators/extended/get_time/char/2.cc expects that
%a in the de_DE locale is "Di" but on FreeBSD it's "Di." with a trailing
period. Adjust the input string to be "1971 Di." instead of "Di 1971"
and that way if %a doesn't expect the trailing '.' it simply won't
extract it from the stream.

This fixes:
FAIL: 27_io/manipulators/extended/get_time/char/2.cc  -std=gnu++17 execution test

libstdc++-v3/ChangeLog:

* testsuite/27_io/manipulators/extended/get_time/char/2.cc:
Adjust input string so that it matches %a with or without a
trailing period.

(cherry picked from commit 4decc1062f0f6eb44209d9d5a26a744ffa474648)

libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc

index d4cd0dc30402a8f3dc1ce79fb35588111a679999..6681b049936bb05a74076ab6f50a8efb2e41a841 100644 (file)
@@ -35,9 +35,9 @@ void test01()
   VERIFY( loc_de != loc_c );
   istringstream iss;
   iss.imbue(loc_de);
-  iss.str("Di 1971");
-  tm time1;
-  iss >> get_time(&time1, "%a %Y");
+  iss.str("1971 Di."); // %a is "Di" on some targets, "Di." on others.
+  tm time1{};
+  iss >> get_time(&time1, "%Y %a");
   VERIFY(time1.tm_wday == 2);
   VERIFY(time1.tm_year == 71);
 }