https://gcc.gnu.org/g:6f0bd7cfb3288b667ab8e8ec18984a67c4238a86

commit r12-10539-g6f0bd7cfb3288b667ab8e8ec18984a67c4238a86
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Apr 10 13:24:51 2024 +0100

    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:
---
 .../testsuite/27_io/manipulators/extended/get_time/char/2.cc        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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);
 }

Reply via email to