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
11 // REQUIRES: locale.fr_FR.UTF-8
12 // REQUIRES: locale.ru_RU.UTF-8
13 // REQUIRES: locale.zh_CN.UTF-8
15 // Russia uses ',' for the decimal separator. GLIBC returns '.'
20 // class moneypunct_byname<charT, International>
22 // charT decimal_point() const;
28 #include "platform_support.h" // locale name macros
31 : public std::moneypunct_byname<char, false>
34 explicit Fnf(const std::string& nm, std::size_t refs = 0)
35 : std::moneypunct_byname<char, false>(nm, refs) {}
39 : public std::moneypunct_byname<char, true>
42 explicit Fnt(const std::string& nm, std::size_t refs = 0)
43 : std::moneypunct_byname<char, true>(nm, refs) {}
47 : public std::moneypunct_byname<wchar_t, false>
50 explicit Fwf(const std::string& nm, std::size_t refs = 0)
51 : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
55 : public std::moneypunct_byname<wchar_t, true>
58 explicit Fwt(const std::string& nm, std::size_t refs = 0)
59 : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
66 assert(f.decimal_point() == std::numeric_limits<char>::max());
70 assert(f.decimal_point() == std::numeric_limits<char>::max());
74 assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
78 assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
82 Fnf f(LOCALE_en_US_UTF_8, 1);
83 assert(f.decimal_point() == '.');
86 Fnt f(LOCALE_en_US_UTF_8, 1);
87 assert(f.decimal_point() == '.');
90 Fwf f(LOCALE_en_US_UTF_8, 1);
91 assert(f.decimal_point() == L'.');
94 Fwt f(LOCALE_en_US_UTF_8, 1);
95 assert(f.decimal_point() == L'.');
99 Fnf f(LOCALE_fr_FR_UTF_8, 1);
100 assert(f.decimal_point() == ',');
103 Fnt f(LOCALE_fr_FR_UTF_8, 1);
104 assert(f.decimal_point() == ',');
107 Fwf f(LOCALE_fr_FR_UTF_8, 1);
108 assert(f.decimal_point() == L',');
111 Fwt f(LOCALE_fr_FR_UTF_8, 1);
112 assert(f.decimal_point() == L',');
116 Fnf f(LOCALE_ru_RU_UTF_8, 1);
117 assert(f.decimal_point() == ',');
120 Fnt f(LOCALE_ru_RU_UTF_8, 1);
121 assert(f.decimal_point() == ',');
124 Fwf f(LOCALE_ru_RU_UTF_8, 1);
125 assert(f.decimal_point() == L',');
128 Fwt f(LOCALE_ru_RU_UTF_8, 1);
129 assert(f.decimal_point() == L',');
133 Fnf f(LOCALE_zh_CN_UTF_8, 1);
134 assert(f.decimal_point() == '.');
137 Fnt f(LOCALE_zh_CN_UTF_8, 1);
138 assert(f.decimal_point() == '.');
141 Fwf f(LOCALE_zh_CN_UTF_8, 1);
142 assert(f.decimal_point() == L'.');
145 Fwt f(LOCALE_zh_CN_UTF_8, 1);
146 assert(f.decimal_point() == L'.');