vangyzen updated this revision to Diff 78919.
vangyzen added a comment.

Fix comment

vim + Caps Lock == :(


https://reviews.llvm.org/D26979

Files:
  
test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
  
test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp

Index: test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
===================================================================
--- test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -20,6 +20,7 @@
 // XFAIL: linux-gnu
 
 #include <locale>
+#include <clocale>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros
@@ -40,29 +41,43 @@
         }
     }
     {
+        char expected = ',';
+        const char *ret = std::setlocale(LC_NUMERIC, LOCALE_en_US_UTF_8);
+        if (ret != NULL)
+        {
+            expected = *std::localeconv()->thousands_sep;
+            (void) std::setlocale(LC_NUMERIC, "C");
+        }
         std::locale l(LOCALE_en_US_UTF_8);
         {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.thousands_sep() == ',');
+            assert(np.thousands_sep() == expected);
         }
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.thousands_sep() == L',');
+            assert(np.thousands_sep() == expected);
         }
     }
     {
+        char expected = ',';
+        const char *ret = std::setlocale(LC_NUMERIC, LOCALE_fr_FR_UTF_8);
+        if (ret != NULL)
+        {
+            expected = *std::localeconv()->thousands_sep;
+            (void) std::setlocale(LC_NUMERIC, "C");
+        }
         std::locale l(LOCALE_fr_FR_UTF_8);
         {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.thousands_sep() == ',');
+            assert(np.thousands_sep() == expected);
         }
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.thousands_sep() == L',');
+            assert(np.thousands_sep() == expected);
         }
     }
 }
Index: test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
===================================================================
--- test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
+++ test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -20,6 +20,7 @@
 // XFAIL: linux-gnu
 
 #include <locale>
+#include <clocale>
 #include <cassert>
 
 #include "platform_support.h" // locale name macros
@@ -40,29 +41,43 @@
         }
     }
     {
+        const char *expected = "\3\3";
+        const char *ret = std::setlocale(LC_NUMERIC, LOCALE_en_US_UTF_8);
+        if (ret != NULL)
+        {
+            expected = std::localeconv()->grouping;
+            (void) std::setlocale(LC_NUMERIC, "C");
+        }
         std::locale l(LOCALE_en_US_UTF_8);
         {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.grouping() == "\3\3");
+            assert(np.grouping() == expected);
         }
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.grouping() == "\3\3");
+            assert(np.grouping() == expected);
         }
     }
     {
+        const char *expected = "\x7F";
+        const char *ret = std::setlocale(LC_NUMERIC, LOCALE_fr_FR_UTF_8);
+        if (ret != NULL)
+        {
+            expected = std::localeconv()->grouping;
+            (void) std::setlocale(LC_NUMERIC, "C");
+        }
         std::locale l(LOCALE_fr_FR_UTF_8);
         {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.grouping() == "\x7F");
+            assert(np.grouping() == expected);
         }
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-            assert(np.grouping() == "\x7F");
+            assert(np.grouping() == expected);
         }
     }
 }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to