From: Jonathan Wakely Date: Wed, 10 Apr 2024 12:24:51 +0000 (+0100) Subject: libstdc++: Adjust expected locale-dependent date formats in tests X-Git-Tag: releases/gcc-12.4.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f0bd7cfb3288b667ab8e8ec18984a67c4238a86;p=thirdparty%2Fgcc.git libstdc++: Adjust expected locale-dependent date formats in tests 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) --- diff --git a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc index d4cd0dc30402..6681b049936b 100644 --- a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc +++ b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc @@ -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); }