[backport gcc-4.8/trunk r195971 ] Date: Mon, 11 Feb 2013 15:33:59 +0000 From: Julian Brown Subject: [PATCH, libstdc++] Fix 22_locale/time_get/get_weekday/char/38081-[12].cc tests for glibc 2.17 List-Id: Hi, It seems that glibc 2.17 changes the abbreviated names of weekdays for "ru_RU" locales by removing an extraneous ".", as described in: http://sourceware.org/bugzilla/show_bug.cgi?id=10873 An earlier patch (circa glibc 2.14) changed (IIUC!) archaic/unusual three-letter abbreviations to more-common two-letter abbreviations, but included dots after each weekday name, which was apparently still wrong. But, the two tests of this feature in the libstdc++ testsuite expect those dots to be present, so they fail. So, the attached patch simply removes the expectation that dots are present in the abbreviated names from the libstdc++ tests in question, if the glibc version in use is recent enough. The tests pass (with a current gcc, trunk eglibc) with the attached patch, and fail (for me) without it (cross-testing to ARM Linux, for no particular reason). OK to apply? Thanks, Julian libstdc++-v3/ 2013-02-12 Julian Brown * testsuite/22_locale/time_get/get_weekday/char/38081-1.cc (test01): Don't expect dots after abbreviated weekday names for ru_RU for glibc versions >= 2.17. * testsuite/22_locale/time_get/get_weekday/char/38081-2.cc (test01): Likewise. --- gcc-4.6.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc.~1~ 2011-07-22 18:47:20.000000000 +0200 +++ gcc-4.6.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc 2013-03-02 14:51:16.355461820 +0100 @@ -50,7 +50,11 @@ void test01() // ios_base::iostate&, tm*) const #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) +# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17 + iss.str("\xbf\xdd"); +# else iss.str("\xbf\xdd\x2e"); +# endif #else iss.str("\xbf\xdd\xd4"); #endif @@ -72,7 +76,11 @@ void test01() VERIFY( errorstate == ios_base::eofbit ); #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) +# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17 + iss.str("\xbf\xdd\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda"); +# else iss.str("\xbf\xdd\x2e\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda"); +# endif #else iss.str("\xbf\xdd\xd4\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda"); #endif --- gcc-4.6.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc.~1~ 2011-07-22 18:47:20.000000000 +0200 +++ gcc-4.6.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc 2013-03-02 14:51:16.355461820 +0100 @@ -51,6 +51,15 @@ void test01() // ios_base::iostate&, tm*) const #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) +# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17 + const char* awdays[7] = { "\u0412\u0441", + "\u041F\u043D", + "\u0412\u0442", + "\u0421\u0440", + "\u0427\u0442", + "\u041F\u0442", + "\u0421\u0431" }; +# else const char* awdays[7] = { "\u0412\u0441\u002E", "\u041F\u043D\u002E", "\u0412\u0442\u002E", @@ -58,6 +67,7 @@ void test01() "\u0427\u0442\u002E", "\u041F\u0442\u002E", "\u0421\u0431\u002E" }; +#endif #else const char* awdays[7] = { "\u0412\u0441\u043A", "\u041F\u043D\u0434",