1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // REQUIRES: locale.en_US.UTF-8
14 // template <class charT> class ctype_byname;
16 // charT widen(char c) const;
18 // I doubt this test is portable
25 #include "platform_support.h" // locale name macros
32 typedef std::ctype_byname<wchar_t> F;
33 std::locale ll(l, new F(LOCALE_en_US_UTF_8));
34 const F& f = std::use_facet<F>(ll);
36 assert(f.widen(' ') == L' ');
37 assert(f.widen('A') == L'A');
38 assert(f.widen('\x07') == L'\x07');
39 assert(f.widen('.') == L'.');
40 assert(f.widen('a') == L'a');
41 assert(f.widen('1') == L'1');
42 assert(f.widen(char(-5)) == wchar_t(-1));
48 typedef std::ctype_byname<wchar_t> F;
49 std::locale ll(l, new F("C"));
50 const F& f = std::use_facet<F>(ll);
52 assert(f.widen(' ') == L' ');
53 assert(f.widen('A') == L'A');
54 assert(f.widen('\x07') == L'\x07');
55 assert(f.widen('.') == L'.');
56 assert(f.widen('a') == L'a');
57 assert(f.widen('1') == L'1');
59 assert(f.widen(char(-5)) == L'\u00fb');
61 assert(f.widen(char(-5)) == wchar_t(-1));