[libcxx-commits] [libcxx] 31272e4 - [libc++] Update locale grouping tests (#119463)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 16 09:51:03 PST 2024


Author: Vitaly Buka
Date: 2024-12-16T12:50:59-05:00
New Revision: 31272e4f83f24fee1bf37ebc8ea7dd4d082edea8

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

LOG: [libc++] Update locale grouping tests (#119463)

Fixes #119047

Added: 
    

Modified: 
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
index ca5b6736f327267..3243db6a5cca656 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
@@ -89,27 +89,22 @@ int main(int, char**)
     }
 #endif
 
-#if defined( _WIN32) || defined(_AIX)
-    std::string us_grouping = "\3";
-#else
-    std::string us_grouping = "\3\3";
-#endif
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
-        assert(f.grouping() == us_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
     {
         Fnt f(LOCALE_en_US_UTF_8, 1);
-        assert(f.grouping() == us_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
-        assert(f.grouping() == us_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
     {
         Fwt f(LOCALE_en_US_UTF_8, 1);
-        assert(f.grouping() == us_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
 #endif
 
@@ -132,27 +127,22 @@ int main(int, char**)
     }
 #endif
 
-#if defined( _WIN32) || defined(_AIX)
-    std::string ru_grouping = "\3";
-#else
-    std::string ru_grouping = "\3\3";
-#endif
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
-        assert(f.grouping() == ru_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
     {
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
-        assert(f.grouping() == ru_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
-        assert(f.grouping() == ru_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
     {
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
-        assert(f.grouping() == ru_grouping);
+        assert(f.grouping() == "\3" || f.grouping() == "\3\3");
     }
 #endif
 

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
index 86c447d400aaae9..1e68bb3967f0f38 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -48,21 +48,13 @@ int main(int, char**)
         {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-#if defined(_WIN32) || defined(_AIX)
-            assert(np.grouping() == "\3");
-#else
-            assert(np.grouping() == "\3\3");
-#endif
+            assert(np.grouping() == "\3" || np.grouping() == "\3\3");
         }
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-#  if defined(_WIN32) || defined(_AIX)
-            assert(np.grouping() == "\3");
-#  else
-            assert(np.grouping() == "\3\3");
-#  endif
+            assert(np.grouping() == "\3" || np.grouping() == "\3\3");
         }
 #endif
     }


        


More information about the libcxx-commits mailing list