[libcxx-commits] [libcxx] e98f6fa - [libcxx] [test] Fix the get_weekday test on glibc

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 14 12:21:32 PST 2022


Author: Martin Storsjö
Date: 2022-02-14T22:21:16+02:00
New Revision: e98f6fa1c7f9081f1ac2591e2c9dfe80776f7d86

URL: https://github.com/llvm/llvm-project/commit/e98f6fa1c7f9081f1ac2591e2c9dfe80776f7d86
DIFF: https://github.com/llvm/llvm-project/commit/e98f6fa1c7f9081f1ac2591e2c9dfe80776f7d86.diff

LOG: [libcxx] [test] Fix the get_weekday test on glibc

This test feeds in the expected utf8 form of weekdays in various
languages, trying to match what libc++ has gathered internally
from `strftime()`. On glibc, the ru_RU.UTF-8 representation of the
tested weekday is spelled with upper case, while the existing
test reference is lower case.

Differential Revision: https://reviews.llvm.org/D118237

Added: 
    

Modified: 
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
index 0ddef03215500..c2d706855a5e8 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
@@ -21,9 +21,6 @@
 // get_weekday(iter_type s, iter_type end, ios_base& str,
 //             ios_base::iostate& err, tm* t) const;
 
-// TODO: investigation needed
-// XFAIL: target={{.*}}-linux-gnu{{.*}}
-
 #include <locale>
 #include <cassert>
 #include "test_macros.h"
@@ -70,7 +67,13 @@ int main(int, char**)
     }
     {
         const my_facet f(LOCALE_ru_RU_UTF_8, 1);
-        const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5"
+        const char in[] =
+#ifdef TEST_HAS_GLIBC
+                          "\xD0\x9F" // Upper case
+#else
+                          "\xD0\xBF" // Lower case
+#endif
+                          "\xD0\xBE\xD0\xBD\xD0\xB5"
                           "\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
                           "\xD0\xBD\xD0\xB8\xD0\xBA";
         err = std::ios_base::goodbit;


        


More information about the libcxx-commits mailing list