aboutsummaryrefslogtreecommitdiffstats
path: root/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:58 +0000
commit53a420fba21cf1644972b34dcd811a43cdb8368d (patch)
tree66a19f6f8b65215772549a51d688492ab8addc0d /test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
parentb50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff)
downloadsrc-53a420fba21cf1644972b34dcd811a43cdb8368d.tar.gz
src-53a420fba21cf1644972b34dcd811a43cdb8368d.zip
Vendor import of libc++ trunk r290819:vendor/libc++/libc++-trunk-r290819
Notes
Notes: svn path=/vendor/libc++/dist/; revision=311123 svn path=/vendor/libc++/libc++-trunk-r290819/; revision=311124; tag=vendor/libc++/libc++-trunk-r290819
Diffstat (limited to 'test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp')
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
index e5c49defa11f..8f51d12d7c75 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -17,7 +17,6 @@
// I doubt this test is portable
-// XFAIL: linux
#include <locale>
#include <cassert>
@@ -28,10 +27,11 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.widen(' ') == L' ');
assert(f.widen('A') == L'A');
@@ -43,10 +43,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.widen(' ') == L' ');
assert(f.widen('A') == L'A');
@@ -54,7 +55,11 @@ int main()
assert(f.widen('.') == L'.');
assert(f.widen('a') == L'a');
assert(f.widen('1') == L'1');
- assert(f.widen(char(-5)) == wchar_t(251));
+#ifdef __APPLE__
+ assert(f.widen(char(-5)) == L'\u00fb');
+#else
+ assert(f.widen(char(-5)) == wchar_t(-1));
+#endif
}
}
}