Index: projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp =================================================================== --- projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp +++ projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp @@ -16,10 +16,8 @@ // string grouping() const; -// TODO: investigation needed -// XFAIL: linux-gnu - #include +#include #include #include "platform_support.h" // locale name macros @@ -40,29 +38,37 @@ } } { + assert(std::setlocale(LC_NUMERIC, LOCALE_en_US_UTF_8) != NULL); + char *expected = strdup(std::localeconv()->grouping); + assert(std::setlocale(LC_NUMERIC, "C") != NULL); 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); } + free(expected); } { + assert(std::setlocale(LC_NUMERIC, LOCALE_fr_FR_UTF_8) != NULL); + char *expected = strdup(std::localeconv()->grouping); + assert(std::setlocale(LC_NUMERIC, "C") != NULL); 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); } + free(expected); } } Index: projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp =================================================================== --- projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp +++ projects/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp @@ -16,10 +16,8 @@ // char_type thousands_sep() const; -// TODO: investigation needed -// XFAIL: linux-gnu - #include +#include #include #include "platform_support.h" // locale name macros @@ -40,29 +38,45 @@ } } { + char expected; + wchar_t wexpected; + assert(std::setlocale(LC_ALL, LOCALE_en_US_UTF_8) != NULL); + const char *ts = std::localeconv()->thousands_sep; + expected = *ts; + int nb = mbtowc(&wexpected, ts, strlen(ts)+1); + assert(nb >= 0); + assert(std::setlocale(LC_ALL, "C") != NULL); 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() == wexpected); } } { + char expected; + wchar_t wexpected; + assert(std::setlocale(LC_ALL, LOCALE_fr_FR_UTF_8) != NULL); + const char *ts = std::localeconv()->thousands_sep; + expected = *ts; + int nb = mbtowc(&wexpected, ts, strlen(ts)+1); + assert(nb >= 0); + assert(std::setlocale(LC_ALL, "C") != NULL); 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() == wexpected); } } }