This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix 22_locale/time_put failures with recent glibc


Hello,

now that ctype<wchar_t>::do_is is fixed, I'd thought the 
22_locale/time_put testcase failures should be gone, but
they weren't :-(

This turned out to be caused by a recent glibc that I'm
using, which uses "So" instead of "Son" as the abbreviated
name for Sunday in the de_DE locale.  As the test case test
explicitly for "Son", this leads to those failures.

I'm not sure what the exact reason for the glibc change was,
but it certainly looks like a deliberate modification:

CVS log for libc/localedata/locales/de_DE:
Revision 1.16 / (download) - annotate - [select for diffs] , Tue May 6 23:41:43 2003 UTC (4 months, 3 weeks ago) by drepper 
Branch: MAIN 
CVS Tags: HEAD 
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored) 
Use two-letter abday values.

Simply changing the test case to test for "So" instead would
probably annoy people who aren't on the latest glibc level yet, 
so I'd suggest to just allow either.

Tested on s390-ibm-linux and s390x-ibm-linux.  The patch
fixes the 6 remaining 22_locale/time_put testcases on both
platforms.
OK?

Bye,
Ulrich

ChangeLog:

	* 22_locale/time_put/put/char/2.cc (test_02): Allow either "Son" or 
	"So" as abbreviated name for Sunday in de_DE locale.
	* 22_locale/time_put/put/wchar_t/2.cc (test_02): Likewise.


Index: libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc,v
retrieving revision 1.5
diff -c -p -r1.5 2.cc
*** libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc	23 Sep 2003 20:02:37 -0000	1.5
--- libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc	26 Sep 2003 22:26:29 -0000
*************** void test02()
*** 52,58 ****
  
    iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a');
    string result2 = oss.str();
!   VERIFY( result2 == "Son" );
  
    oss.str(empty); // "%d.%m.%Y"
    iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x');
--- 52,58 ----
  
    iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a');
    string result2 = oss.str();
!   VERIFY( result2 == "Son" || result2 == "So" );
  
    oss.str(empty); // "%d.%m.%Y"
    iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x');
Index: libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc,v
retrieving revision 1.4
diff -c -p -r1.4 2.cc
*** libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc	23 Sep 2003 20:02:37 -0000	1.4
--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc	26 Sep 2003 22:26:29 -0000
*************** void test02()
*** 52,58 ****
  
    iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a');
    wstring result2 = oss.str();
!   VERIFY( result2 == L"Son" );
  
    oss.str(empty); // "%d.%m.%Y"
    iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x');
--- 52,58 ----
  
    iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a');
    wstring result2 = oss.str();
!   VERIFY( result2 == L"Son" || result2 == L"So" );
  
    oss.str(empty); // "%d.%m.%Y"
    iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x');
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]