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 +#include #include #include "platform_support.h" // locale name macros @@ -40,29 +41,41 @@ } } { + const char *expected = "\3\3"; + const char *ret = std::setlocale(LC_NUMERIC, LOCALE_en_US_UTF_8); + if (ret != NULL) + { + expected = std::localeconv()->grouping; + } std::locale l(LOCALE_en_US_UTF_8); { typedef char C; const std::numpunct& np = std::use_facet >(l); - assert(np.grouping() == "\3\3"); + assert(np.grouping() == expected); } { typedef wchar_t C; const std::numpunct& np = std::use_facet >(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; + } std::locale l(LOCALE_fr_FR_UTF_8); { typedef char C; const std::numpunct& np = std::use_facet >(l); - assert(np.grouping() == "\x7F"); + assert(np.grouping() == expected); } { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); - assert(np.grouping() == "\x7F"); + assert(np.grouping() == expected); } } } 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 +#include #include #include "platform_support.h" // locale name macros @@ -40,29 +41,41 @@ } } { + char expected = ','; + const char *ret = std::setlocale(LC_NUMERIC, LOCALE_en_US_UTF_8); + if (ret != NULL) + { + expected = *std::localeconv()->thousands_sep; + } std::locale l(LOCALE_en_US_UTF_8); { typedef char C; const std::numpunct& np = std::use_facet >(l); - assert(np.thousands_sep() == ','); + assert(np.thousands_sep() == expected); } { typedef wchar_t C; const std::numpunct& np = std::use_facet >(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; + } std::locale l(LOCALE_fr_FR_UTF_8); { typedef char C; const std::numpunct& np = std::use_facet >(l); - assert(np.thousands_sep() == ','); + assert(np.thousands_sep() == expected); } { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); - assert(np.thousands_sep() == L','); + assert(np.thousands_sep() == expected); } } }