Windows porting work by Ruben Van Boxem

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@141003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2011-10-03 15:23:59 +00:00
parent 8452d21f41
commit c0d0cbad9e
90 changed files with 558 additions and 343 deletions

View File

@ -16,6 +16,8 @@
#include <fstream> #include <fstream>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test_buf struct test_buf
: public std::basic_filebuf<CharT> : public std::basic_filebuf<CharT>
@ -115,7 +117,7 @@ int main()
std::remove("overflow.dat"); std::remove("overflow.dat");
{ {
test_buf<wchar_t> f; test_buf<wchar_t> f;
f.pubimbue(std::locale("en_US.UTF-8")); f.pubimbue(std::locale(LOCALE_en_US_UTF_8));
assert(f.open("overflow.dat", std::ios_base::out) != 0); assert(f.open("overflow.dat", std::ios_base::out) != 0);
assert(f.sputc(0x4E51) == 0x4E51); assert(f.sputc(0x4E51) == 0x4E51);
assert(f.sputc(0x4E52) == 0x4E52); assert(f.sputc(0x4E52) == 0x4E52);

View File

@ -16,6 +16,8 @@
#include <fstream> #include <fstream>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test_buf struct test_buf
: public std::basic_filebuf<CharT> : public std::basic_filebuf<CharT>
@ -108,7 +110,7 @@ int main()
} }
{ {
test_buf<wchar_t> f; test_buf<wchar_t> f;
f.pubimbue(std::locale("en_US.UTF-8")); f.pubimbue(std::locale(LOCALE_en_US_UTF_8));
assert(f.open("underflow_utf8.dat", std::ios_base::in) != 0); assert(f.open("underflow_utf8.dat", std::ios_base::in) != 0);
assert(f.is_open()); assert(f.is_open());
assert(f.sbumpc() == 0x4E51); assert(f.sbumpc() == 0x4E51);

View File

@ -14,6 +14,8 @@
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct testbuf struct testbuf
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -39,7 +41,7 @@ int main()
{ {
testbuf<char> sb(" -$1,234,567.89"); testbuf<char> sb(" -$1,234,567.89");
std::istream is(&sb); std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0; long double x = 0;
is >> std::get_money(x, false); is >> std::get_money(x, false);
assert(x == -123456789); assert(x == -123456789);
@ -47,7 +49,7 @@ int main()
{ {
testbuf<char> sb(" -USD 1,234,567.89"); testbuf<char> sb(" -USD 1,234,567.89");
std::istream is(&sb); std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0; long double x = 0;
is >> std::get_money(x, true); is >> std::get_money(x, true);
assert(x == -123456789); assert(x == -123456789);
@ -55,7 +57,7 @@ int main()
{ {
testbuf<wchar_t> sb(L" -$1,234,567.89"); testbuf<wchar_t> sb(L" -$1,234,567.89");
std::wistream is(&sb); std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0; long double x = 0;
is >> std::get_money(x, false); is >> std::get_money(x, false);
assert(x == -123456789); assert(x == -123456789);
@ -63,7 +65,7 @@ int main()
{ {
testbuf<wchar_t> sb(L" -USD 1,234,567.89"); testbuf<wchar_t> sb(L" -USD 1,234,567.89");
std::wistream is(&sb); std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0; long double x = 0;
is >> std::get_money(x, true); is >> std::get_money(x, true);
assert(x == -123456789); assert(x == -123456789);

View File

@ -14,6 +14,8 @@
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct testbuf struct testbuf
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -39,7 +41,7 @@ int main()
{ {
testbuf<char> sb(" Sat Dec 31 23:55:59 2061"); testbuf<char> sb(" Sat Dec 31 23:55:59 2061");
std::istream is(&sb); std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0}; std::tm t = {0};
is >> std::get_time(&t, "%c"); is >> std::get_time(&t, "%c");
assert(t.tm_sec == 59); assert(t.tm_sec == 59);
@ -55,7 +57,7 @@ int main()
{ {
testbuf<wchar_t> sb(L" Sat Dec 31 23:55:59 2061"); testbuf<wchar_t> sb(L" Sat Dec 31 23:55:59 2061");
std::wistream is(&sb); std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8")); is.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0}; std::tm t = {0};
is >> std::get_time(&t, L"%c"); is >> std::get_time(&t, L"%c");
assert(t.tm_sec == 59); assert(t.tm_sec == 59);

View File

@ -14,6 +14,8 @@
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
class testbuf class testbuf
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -51,7 +53,7 @@ int main()
{ {
testbuf<char> sb; testbuf<char> sb;
std::ostream os(&sb); std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os); showbase(os);
long double x = -123456789; long double x = -123456789;
os << std::put_money(x, false); os << std::put_money(x, false);
@ -60,7 +62,7 @@ int main()
{ {
testbuf<char> sb; testbuf<char> sb;
std::ostream os(&sb); std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os); showbase(os);
long double x = -123456789; long double x = -123456789;
os << std::put_money(x, true); os << std::put_money(x, true);
@ -69,7 +71,7 @@ int main()
{ {
testbuf<wchar_t> sb; testbuf<wchar_t> sb;
std::wostream os(&sb); std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os); showbase(os);
long double x = -123456789; long double x = -123456789;
os << std::put_money(x, false); os << std::put_money(x, false);
@ -78,7 +80,7 @@ int main()
{ {
testbuf<wchar_t> sb; testbuf<wchar_t> sb;
std::wostream os(&sb); std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os); showbase(os);
long double x = -123456789; long double x = -123456789;
os << std::put_money(x, true); os << std::put_money(x, true);

View File

@ -14,6 +14,8 @@
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
class testbuf class testbuf
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -51,7 +53,7 @@ int main()
{ {
testbuf<char> sb; testbuf<char> sb;
std::ostream os(&sb); std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0}; std::tm t = {0};
t.tm_sec = 59; t.tm_sec = 59;
t.tm_min = 55; t.tm_min = 55;
@ -66,7 +68,7 @@ int main()
{ {
testbuf<wchar_t> sb; testbuf<wchar_t> sb;
std::wostream os(&sb); std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8")); os.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0}; std::tm t = {0};
t.tm_sec = 59; t.tm_sec = 59;
t.tm_min = 55; t.tm_min = 55;

View File

@ -18,6 +18,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class test class test
: public std::ios : public std::ios
{ {
@ -34,7 +36,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
{ {
if (ev == std::ios_base::imbue_event) if (ev == std::ios_base::imbue_event)
{ {
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4); assert(index == 4);
++f1_called; ++f1_called;
} }
@ -47,6 +49,6 @@ int main()
b.register_callback(f1, 4); b.register_callback(f1, 4);
b.register_callback(f1, 4); b.register_callback(f1, 4);
b.register_callback(f1, 4); b.register_callback(f1, 4);
std::locale l = b.imbue(std::locale("en_US.UTF-8")); std::locale l = b.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(f1_called == 3); assert(f1_called == 3);
} }

View File

@ -18,6 +18,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class test class test
: public std::ios : public std::ios
{ {
@ -39,7 +41,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert( f2_called); assert( f2_called);
assert( f3_called); assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4); assert(index == 4);
f1_called = true; f1_called = true;
} }
@ -52,7 +54,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);
assert( f3_called); assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 5); assert(index == 5);
f2_called = true; f2_called = true;
} }
@ -65,7 +67,7 @@ void f3(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);
assert(!f3_called); assert(!f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 6); assert(index == 6);
f3_called = true; f3_called = true;
} }
@ -78,9 +80,9 @@ int main()
b.register_callback(f1, 4); b.register_callback(f1, 4);
b.register_callback(f2, 5); b.register_callback(f2, 5);
b.register_callback(f3, 6); b.register_callback(f3, 6);
std::locale l = b.imbue(std::locale("en_US.UTF-8")); std::locale l = b.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(l.name() == std::string("C")); assert(l.name() == std::string("C"));
assert(b.getloc().name() == std::string("en_US.UTF-8")); assert(b.getloc().name() == std::string(LOCALE_en_US_UTF_8));
assert(f1_called); assert(f1_called);
assert(f2_called); assert(f2_called);
assert(f3_called); assert(f3_called);

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
struct testbuf struct testbuf
: public std::streambuf : public std::streambuf
{ {
@ -38,7 +40,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!g1_called); assert(!g1_called);
assert(!g2_called); assert(!g2_called);
assert(!g3_called); assert(!g3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4); assert(index == 4);
f1_called = true; f1_called = true;
} }
@ -53,7 +55,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!g1_called); assert(!g1_called);
assert(!g2_called); assert(!g2_called);
assert(!g3_called); assert(!g3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 5); assert(index == 5);
f2_called = true; f2_called = true;
} }
@ -68,7 +70,7 @@ void g1(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!g1_called); assert(!g1_called);
assert( g2_called); assert( g2_called);
assert( g3_called); assert( g3_called);
assert(stream.getloc().name() == "fr_FR.UTF-8"); assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(index == 7); assert(index == 7);
g1_called = true; g1_called = true;
} }
@ -83,7 +85,7 @@ void g2(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!g1_called); assert(!g1_called);
assert(!g2_called); assert(!g2_called);
assert( g3_called); assert( g3_called);
assert(stream.getloc().name() == "fr_FR.UTF-8"); assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(index == 8); assert(index == 8);
g2_called = true; g2_called = true;
} }
@ -98,7 +100,7 @@ void g3(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!g1_called); assert(!g1_called);
assert(!g2_called); assert(!g2_called);
assert(!g3_called); assert(!g3_called);
assert(stream.getloc().name() == "fr_FR.UTF-8"); assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(index == 9); assert(index == 9);
g3_called = true; g3_called = true;
} }
@ -111,7 +113,7 @@ int main()
ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed); ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed);
ios1.precision(1); ios1.precision(1);
ios1.width(11); ios1.width(11);
ios1.imbue(std::locale("en_US.UTF-8")); ios1.imbue(std::locale(LOCALE_en_US_UTF_8));
ios1.exceptions(std::ios::failbit); ios1.exceptions(std::ios::failbit);
ios1.setstate(std::ios::eofbit); ios1.setstate(std::ios::eofbit);
ios1.register_callback(f1, 4); ios1.register_callback(f1, 4);
@ -131,7 +133,7 @@ int main()
ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.flags(std::ios::showpoint | std::ios::uppercase);
ios2.precision(2); ios2.precision(2);
ios2.width(12); ios2.width(12);
ios2.imbue(std::locale("fr_FR.UTF-8")); ios2.imbue(std::locale(LOCALE_fr_FR_UTF_8));
ios2.exceptions(std::ios::eofbit); ios2.exceptions(std::ios::eofbit);
ios2.setstate(std::ios::goodbit); ios2.setstate(std::ios::goodbit);
ios2.register_callback(g1, 7); ios2.register_callback(g1, 7);
@ -165,7 +167,7 @@ int main()
assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase));
assert(ios1.precision() == 2); assert(ios1.precision() == 2);
assert(ios1.width() == 12); assert(ios1.width() == 12);
assert(ios1.getloc().name() == "fr_FR.UTF-8"); assert(ios1.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(ios1.exceptions() == std::ios::eofbit); assert(ios1.exceptions() == std::ios::eofbit);
assert(f1_called); assert(f1_called);
assert(f2_called); assert(f2_called);

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
struct testbuf struct testbuf
: public std::streambuf : public std::streambuf
{ {
@ -33,7 +35,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert( f2_called); assert( f2_called);
assert( f3_called); assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4); assert(index == 4);
f1_called = true; f1_called = true;
} }
@ -46,7 +48,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);
assert( f3_called); assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 5); assert(index == 5);
f2_called = true; f2_called = true;
} }
@ -59,7 +61,7 @@ void f3(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);
assert(!f3_called); assert(!f3_called);
assert(stream.getloc().name() == "en_US.UTF-8"); assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 6); assert(index == 6);
f3_called = true; f3_called = true;
} }
@ -72,9 +74,9 @@ int main()
ios.register_callback(f1, 4); ios.register_callback(f1, 4);
ios.register_callback(f2, 5); ios.register_callback(f2, 5);
ios.register_callback(f3, 6); ios.register_callback(f3, 6);
std::locale l = ios.imbue(std::locale("en_US.UTF-8")); std::locale l = ios.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(l.name() == std::string("C")); assert(l.name() == std::string("C"));
assert(ios.getloc().name() == std::string("en_US.UTF-8")); assert(ios.getloc().name() == std::string(LOCALE_en_US_UTF_8));
assert(f1_called); assert(f1_called);
assert(f2_called); assert(f2_called);
assert(f3_called); assert(f3_called);
@ -88,10 +90,10 @@ int main()
ios.register_callback(f1, 4); ios.register_callback(f1, 4);
ios.register_callback(f2, 5); ios.register_callback(f2, 5);
ios.register_callback(f3, 6); ios.register_callback(f3, 6);
std::locale l = ios.imbue(std::locale("en_US.UTF-8")); std::locale l = ios.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(l.name() == std::string("C")); assert(l.name() == std::string("C"));
assert(ios.getloc().name() == std::string("en_US.UTF-8")); assert(ios.getloc().name() == std::string(LOCALE_en_US_UTF_8));
assert(sb.getloc().name() == std::string("en_US.UTF-8")); assert(sb.getloc().name() == std::string(LOCALE_en_US_UTF_8));
assert(f1_called); assert(f1_called);
assert(f2_called); assert(f2_called);
assert(f3_called); assert(f3_called);

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
struct testbuf struct testbuf
: public std::streambuf : public std::streambuf
{ {
@ -82,7 +84,7 @@ int main()
ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.flags(std::ios::showpoint | std::ios::uppercase);
ios2.precision(2); ios2.precision(2);
ios2.width(12); ios2.width(12);
ios2.imbue(std::locale("fr_FR.UTF-8")); ios2.imbue(std::locale(LOCALE_fr_FR_UTF_8));
ios2.exceptions(std::ios::eofbit); ios2.exceptions(std::ios::eofbit);
ios2.setstate(std::ios::goodbit); ios2.setstate(std::ios::goodbit);
ios2.register_callback(g1, 7); ios2.register_callback(g1, 7);
@ -107,7 +109,7 @@ int main()
assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase));
assert(ios1.precision() == 2); assert(ios1.precision() == 2);
assert(ios1.width() == 12); assert(ios1.width() == 12);
assert(ios1.getloc().name() == "fr_FR.UTF-8"); assert(ios1.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(ios1.exceptions() == std::ios::eofbit); assert(ios1.exceptions() == std::ios::eofbit);
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
struct testbuf struct testbuf
: public std::streambuf : public std::streambuf
{ {
@ -73,7 +75,7 @@ int main()
ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed); ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed);
ios1.precision(1); ios1.precision(1);
ios1.width(11); ios1.width(11);
ios1.imbue(std::locale("en_US.UTF-8")); ios1.imbue(std::locale(LOCALE_en_US_UTF_8));
ios1.exceptions(std::ios::failbit); ios1.exceptions(std::ios::failbit);
ios1.setstate(std::ios::eofbit); ios1.setstate(std::ios::eofbit);
ios1.register_callback(f1, 4); ios1.register_callback(f1, 4);
@ -93,7 +95,7 @@ int main()
ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.flags(std::ios::showpoint | std::ios::uppercase);
ios2.precision(2); ios2.precision(2);
ios2.width(12); ios2.width(12);
ios2.imbue(std::locale("fr_FR.UTF-8")); ios2.imbue(std::locale(LOCALE_fr_FR_UTF_8));
ios2.exceptions(std::ios::eofbit); ios2.exceptions(std::ios::eofbit);
ios2.setstate(std::ios::goodbit); ios2.setstate(std::ios::goodbit);
ios2.register_callback(g1, 7); ios2.register_callback(g1, 7);
@ -118,7 +120,7 @@ int main()
assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase));
assert(ios1.precision() == 2); assert(ios1.precision() == 2);
assert(ios1.width() == 12); assert(ios1.width() == 12);
assert(ios1.getloc().name() == "fr_FR.UTF-8"); assert(ios1.getloc().name() == LOCALE_fr_FR_UTF_8);
assert(ios1.exceptions() == std::ios::eofbit); assert(ios1.exceptions() == std::ios::eofbit);
assert(!f1_called); assert(!f1_called);
assert(!f2_called); assert(!f2_called);
@ -147,7 +149,7 @@ int main()
assert(ios2.flags() == (std::ios::boolalpha | std::ios::dec | std::ios::fixed)); assert(ios2.flags() == (std::ios::boolalpha | std::ios::dec | std::ios::fixed));
assert(ios2.precision() == 1); assert(ios2.precision() == 1);
assert(ios2.width() == 11); assert(ios2.width() == 11);
assert(ios2.getloc().name() == "en_US.UTF-8"); assert(ios2.getloc().name() == LOCALE_en_US_UTF_8);
assert(ios2.exceptions() == std::ios::failbit); assert(ios2.exceptions() == std::ios::failbit);
assert(ios2.iword(0) == 1); assert(ios2.iword(0) == 1);
assert(ios2.iword(1) == 2); assert(ios2.iword(1) == 2);

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test struct test
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -70,7 +72,7 @@ int main()
t.setp(&p1, &p3); t.setp(&p1, &p3);
test<wchar_t> t2 = t; test<wchar_t> t2 = t;
} }
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{ {
test<char> t; test<char> t;
test<char> t2 = t; test<char> t2 = t;

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test struct test
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -42,13 +44,13 @@ int main()
test<wchar_t> t; test<wchar_t> t;
assert(t.getloc().name() == "C"); assert(t.getloc().name() == "C");
} }
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{ {
test<char> t; test<char> t;
assert(t.getloc().name() == "en_US.UTF-8"); assert(t.getloc().name() == LOCALE_en_US_UTF_8);
} }
{ {
test<wchar_t> t; test<wchar_t> t;
assert(t.getloc().name() == "en_US.UTF-8"); assert(t.getloc().name() == LOCALE_en_US_UTF_8);
} }
} }

View File

@ -18,6 +18,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test struct test
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -26,7 +28,7 @@ struct test
void imbue(const std::locale&) void imbue(const std::locale&)
{ {
assert(this->getloc().name() == "en_US.UTF-8"); assert(this->getloc().name() == LOCALE_en_US_UTF_8);
} }
}; };
@ -36,11 +38,11 @@ int main()
test<char> t; test<char> t;
assert(t.getloc().name() == "C"); assert(t.getloc().name() == "C");
} }
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{ {
test<char> t; test<char> t;
assert(t.getloc().name() == "en_US.UTF-8"); assert(t.getloc().name() == LOCALE_en_US_UTF_8);
assert(t.pubimbue(std::locale("fr_FR.UTF-8")).name() == "en_US.UTF-8"); assert(t.pubimbue(std::locale(LOCALE_fr_FR_UTF_8)).name() == "en_US.UTF-8");
assert(t.getloc().name() == "fr_FR.UTF-8"); assert(t.getloc().name() == LOCALE_fr_FR_UTF_8);
} }
} }

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test struct test
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -75,7 +77,7 @@ int main()
test<wchar_t> t2; test<wchar_t> t2;
t2 = t; t2 = t;
} }
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{ {
test<char> t; test<char> t;
test<char> t2; test<char> t2;

View File

@ -17,6 +17,8 @@
#include <streambuf> #include <streambuf>
#include <cassert> #include <cassert>
#include "../../../../../platform_support.h" // locale name macros
template <class CharT> template <class CharT>
struct test struct test
: public std::basic_streambuf<CharT> : public std::basic_streambuf<CharT>
@ -85,7 +87,7 @@ int main()
test<wchar_t> t2; test<wchar_t> t2;
swap(t2, t); swap(t2, t);
} }
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
{ {
test<char> t; test<char> t;
test<char> t2; test<char> t2;

View File

@ -24,10 +24,12 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
const std::collate<char>& f = std::use_facet<std::collate<char> >(l); const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
std::string s2("aaaaaaA"); std::string s2("aaaaaaA");

View File

@ -19,9 +19,11 @@
#include <string> #include <string>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
std::string x1("1234"); std::string x1("1234");
std::string x2("12345"); std::string x2("12345");

View File

@ -19,12 +19,14 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
// Ensure that the default locale is not C. If it is, the second tests will fail. // Ensure that the default locale is not C. If it is, the second tests will fail.
setenv("LANG", "en_US.UTF-8", 1); putenv(const_cast<char*>("LANG=" LOCALE_en_US_UTF_8));
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
std::string x("1234"); std::string x("1234");
const std::collate<char>& f = std::use_facet<std::collate<char> >(l); const std::collate<char>& f = std::use_facet<std::collate<char> >(l);

View File

@ -27,9 +27,11 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
assert(std::has_facet<std::collate_byname<char> >(l)); assert(std::has_facet<std::collate_byname<char> >(l));
assert(&std::use_facet<std::collate<char> >(l) assert(&std::use_facet<std::collate<char> >(l)

View File

@ -17,6 +17,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> F; typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> F;
class my_facet class my_facet
@ -38,12 +40,12 @@ int my_facet::count = 0;
int main() int main()
{ {
{ {
std::locale l(std::locale::classic(), new my_facet("en_US.UTF-8")); std::locale l(std::locale::classic(), new my_facet(LOCALE_en_US_UTF_8));
assert(my_facet::count == 1); assert(my_facet::count == 1);
} }
assert(my_facet::count == 0); assert(my_facet::count == 0);
{ {
my_facet f("en_US.UTF-8", 1); my_facet f(LOCALE_en_US_UTF_8, 1);
assert(my_facet::count == 1); assert(my_facet::count == 1);
{ {
std::locale l(std::locale::classic(), &f); std::locale l(std::locale::classic(), &f);
@ -53,12 +55,12 @@ int main()
} }
assert(my_facet::count == 0); assert(my_facet::count == 0);
{ {
std::locale l(std::locale::classic(), new my_facet(std::string("en_US.UTF-8"))); std::locale l(std::locale::classic(), new my_facet(std::string(LOCALE_en_US_UTF_8)));
assert(my_facet::count == 1); assert(my_facet::count == 1);
} }
assert(my_facet::count == 0); assert(my_facet::count == 0);
{ {
my_facet f(std::string("en_US.UTF-8"), 1); my_facet f(std::string(LOCALE_en_US_UTF_8), 1);
assert(my_facet::count == 1); assert(my_facet::count == 1);
{ {
std::locale l(std::locale::classic(), &f); std::locale l(std::locale::classic(), &f);

View File

@ -17,10 +17,12 @@
#include <type_traits> #include <type_traits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -20,10 +20,12 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -16,10 +16,12 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l(std::string("fr_CA.ISO8859-1")); std::locale l(std::string(LOCALE_fr_CA_ISO8859_1));
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -34,7 +36,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -18,10 +18,12 @@
#include <vector> #include <vector>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("fr_CA.ISO8859-1"); std::locale l(LOCALE_fr_CA_ISO8859_1);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -39,7 +41,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -20,10 +20,12 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -20,10 +20,12 @@
#include <stdio.h> #include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -16,10 +16,12 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<char> F; typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -51,7 +53,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -17,10 +17,12 @@
#include <string> #include <string>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<char> F; typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -54,7 +56,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -16,10 +16,12 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<char> F; typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -51,7 +53,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -17,10 +17,12 @@
#include <string> #include <string>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<char> F; typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);
@ -54,7 +56,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -25,10 +25,12 @@
#include <type_traits> #include <type_traits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
assert(std::has_facet<std::ctype_byname<char> >(l)); assert(std::has_facet<std::ctype_byname<char> >(l));
assert(&std::use_facet<std::ctype<char> >(l) assert(&std::use_facet<std::ctype<char> >(l)

View File

@ -19,10 +19,12 @@
#include <cassert> #include <cassert>
#include <limits.h> #include <limits.h>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -20,10 +20,12 @@
#include <vector> #include <vector>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef std::ctype<wchar_t> F; typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l); const F& f = std::use_facet<F>(l);

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn; typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("en_US.UTF-8"); std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn; typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("fr_FR.UTF-8"); std::string loc_name(LOCALE_fr_FR_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn; typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("ru_RU.UTF-8"); std::string loc_name("LOCALE_ru_RU_UTF_8");
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn; typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("zh_CN.UTF-8"); std::string loc_name(LOCALE_zh_CN_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn; typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("en_US.UTF-8"); std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn; typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("en_US.UTF-8"); std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn; typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("fr_FR.UTF-8"); std::string loc_name(LOCALE_fr_FR_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn; typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("ru_RU.UTF-8"); std::string loc_name(LOCALE_ru_RU_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn; typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("zh_CN.UTF-8"); std::string loc_name(LOCALE_zh_CN_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -20,6 +20,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn; typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet class my_facet
@ -43,7 +45,7 @@ public:
int main() int main()
{ {
std::ios ios(0); std::ios ios(0);
std::string loc_name("en_US.UTF-8"); std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name))); new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(), ios.imbue(std::locale(ios.getloc(),

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == "$"); assert(f.curr_symbol() == "$");
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == "USD "); assert(f.curr_symbol() == "USD ");
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == L"$"); assert(f.curr_symbol() == L"$");
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == L"USD "); assert(f.curr_symbol() == L"USD ");
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == "Eu"); assert(f.curr_symbol() == "Eu");
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == "EUR "); assert(f.curr_symbol() == "EUR ");
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == L"Eu"); assert(f.curr_symbol() == L"Eu");
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == L"EUR "); assert(f.curr_symbol() == L"EUR ");
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == "\xD1\x80\xD1\x83\xD0\xB1""."); assert(f.curr_symbol() == "\xD1\x80\xD1\x83\xD0\xB1"".");
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == "RUB "); assert(f.curr_symbol() == "RUB ");
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == L"\x440\x443\x431""."); assert(f.curr_symbol() == L"\x440\x443\x431"".");
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == L"RUB "); assert(f.curr_symbol() == L"RUB ");
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == "\xEF\xBF\xA5"); assert(f.curr_symbol() == "\xEF\xBF\xA5");
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == "CNY "); assert(f.curr_symbol() == "CNY ");
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == L"\xFFE5"); assert(f.curr_symbol() == L"\xFFE5");
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == L"CNY "); assert(f.curr_symbol() == L"CNY ");
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == '.'); assert(f.decimal_point() == '.');
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == '.'); assert(f.decimal_point() == '.');
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == L'.'); assert(f.decimal_point() == L'.');
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == L'.'); assert(f.decimal_point() == L'.');
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == ','); assert(f.decimal_point() == ',');
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == ','); assert(f.decimal_point() == ',');
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == L','); assert(f.decimal_point() == L',');
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == L','); assert(f.decimal_point() == L',');
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == ','); assert(f.decimal_point() == ',');
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == ','); assert(f.decimal_point() == ',');
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == L','); assert(f.decimal_point() == L',');
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == L','); assert(f.decimal_point() == L',');
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == '.'); assert(f.decimal_point() == '.');
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == '.'); assert(f.decimal_point() == '.');
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == L'.'); assert(f.decimal_point() == L'.');
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == L'.'); assert(f.decimal_point() == L'.');
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2); assert(f.frac_digits() == 2);
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -72,70 +74,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3"); assert(f.grouping() == "\3\3");
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -85,7 +87,7 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -93,7 +95,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -101,7 +103,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -109,7 +111,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -118,7 +120,7 @@ int main()
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value); assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space); assert(p.field[1] == std::money_base::space);
@ -126,7 +128,7 @@ int main()
assert(p.field[3] == std::money_base::sign); assert(p.field[3] == std::money_base::sign);
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value); assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space); assert(p.field[1] == std::money_base::space);
@ -134,7 +136,7 @@ int main()
assert(p.field[3] == std::money_base::sign); assert(p.field[3] == std::money_base::sign);
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value); assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space); assert(p.field[1] == std::money_base::space);
@ -142,7 +144,7 @@ int main()
assert(p.field[3] == std::money_base::sign); assert(p.field[3] == std::money_base::sign);
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value); assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space); assert(p.field[1] == std::money_base::space);
@ -151,7 +153,7 @@ int main()
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -159,7 +161,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -167,7 +169,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -175,7 +177,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -184,7 +186,7 @@ int main()
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol); assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign); assert(p.field[1] == std::money_base::sign);
@ -192,7 +194,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol); assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign); assert(p.field[1] == std::money_base::sign);
@ -200,7 +202,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol); assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign); assert(p.field[1] == std::money_base::sign);
@ -208,7 +210,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format(); std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol); assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign); assert(p.field[1] == std::money_base::sign);

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == "-"); assert(f.negative_sign() == "-");
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == L"-"); assert(f.negative_sign() == L"-");
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -85,7 +87,7 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -93,7 +95,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -101,7 +103,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -109,7 +111,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -118,7 +120,7 @@ int main()
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -126,7 +128,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -134,7 +136,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -142,7 +144,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -151,7 +153,7 @@ int main()
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -159,7 +161,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -167,7 +169,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -175,7 +177,7 @@ int main()
assert(p.field[3] == std::money_base::symbol); assert(p.field[3] == std::money_base::symbol);
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value); assert(p.field[1] == std::money_base::value);
@ -184,7 +186,7 @@ int main()
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -192,7 +194,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -200,7 +202,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);
@ -208,7 +210,7 @@ int main()
assert(p.field[3] == std::money_base::value); assert(p.field[3] == std::money_base::value);
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format(); std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign); assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol); assert(p.field[1] == std::money_base::symbol);

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == ""); assert(f.positive_sign() == "");
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == L""); assert(f.positive_sign() == L"");
} }
} }

View File

@ -17,6 +17,8 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf class Fnf
: public std::moneypunct_byname<char, false> : public std::moneypunct_byname<char, false>
{ {
@ -69,70 +71,70 @@ int main()
} }
{ {
Fnf f("en_US.UTF-8", 1); Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == ','); assert(f.thousands_sep() == ',');
} }
{ {
Fnt f("en_US.UTF-8", 1); Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == ','); assert(f.thousands_sep() == ',');
} }
{ {
Fwf f("en_US.UTF-8", 1); Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == L','); assert(f.thousands_sep() == L',');
} }
{ {
Fwt f("en_US.UTF-8", 1); Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == L','); assert(f.thousands_sep() == L',');
} }
{ {
Fnf f("fr_FR.UTF-8", 1); Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' '); assert(f.thousands_sep() == ' ');
} }
{ {
Fnt f("fr_FR.UTF-8", 1); Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' '); assert(f.thousands_sep() == ' ');
} }
{ {
Fwf f("fr_FR.UTF-8", 1); Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == L' '); assert(f.thousands_sep() == L' ');
} }
{ {
Fwt f("fr_FR.UTF-8", 1); Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == L' '); assert(f.thousands_sep() == L' ');
} }
{ {
Fnf f("ru_RU.UTF-8", 1); Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == ' '); assert(f.thousands_sep() == ' ');
} }
{ {
Fnt f("ru_RU.UTF-8", 1); Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == ' '); assert(f.thousands_sep() == ' ');
} }
{ {
Fwf f("ru_RU.UTF-8", 1); Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == L' '); assert(f.thousands_sep() == L' ');
} }
{ {
Fwt f("ru_RU.UTF-8", 1); Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == L' '); assert(f.thousands_sep() == L' ');
} }
{ {
Fnf f("zh_CN.UTF-8", 1); Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == ','); assert(f.thousands_sep() == ',');
} }
{ {
Fnt f("zh_CN.UTF-8", 1); Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == ','); assert(f.thousands_sep() == ',');
} }
{ {
Fwf f("zh_CN.UTF-8", 1); Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == L','); assert(f.thousands_sep() == L',');
} }
{ {
Fwt f("zh_CN.UTF-8", 1); Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == L','); assert(f.thousands_sep() == L',');
} }
} }

View File

@ -17,6 +17,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_get_byname<char, input_iterator<const char*> > F; typedef std::time_get_byname<char, input_iterator<const char*> > F;
class my_facet class my_facet
@ -30,19 +32,19 @@ public:
int main() int main()
{ {
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
assert(f.date_order() == std::time_base::mdy); assert(f.date_order() == std::time_base::mdy);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy); assert(f.date_order() == std::time_base::dmy);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy); assert(f.date_order() == std::time_base::dmy);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
assert(f.date_order() == std::time_base::ymd); assert(f.date_order() == std::time_base::ymd);
} }
} }

View File

@ -17,6 +17,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F; typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F;
class my_facet class my_facet
@ -30,19 +32,19 @@ public:
int main() int main()
{ {
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
assert(f.date_order() == std::time_base::mdy); assert(f.date_order() == std::time_base::mdy);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy); assert(f.date_order() == std::time_base::dmy);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy); assert(f.date_order() == std::time_base::dmy);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
assert(f.date_order() == std::time_base::ymd); assert(f.date_order() == std::time_base::ymd);
} }
} }

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "06/10/2009"; const char in[] = "06/10/2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "10.06.2009"; const char in[] = "10.06.2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "10.06.2009"; const char in[] = "10.06.2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "2009/06/10"; const char in[] = "2009/06/10";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"06/10/2009"; const wchar_t in[] = L"06/10/2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"10.06.2009"; const wchar_t in[] = L"10.06.2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"10.06.2009"; const wchar_t in[] = L"10.06.2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"2009/06/10"; const wchar_t in[] = L"2009/06/10";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "June"; const char in[] = "June";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "juin"; const char in[] = "juin";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD0\xB8\xD1\x8E\xD0\xBD\xD1\x8F"; const char in[] = "\xD0\xB8\xD1\x8E\xD0\xBD\xD1\x8F";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -67,7 +69,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE5\x85\xAD\xE6\x9C\x88"; const char in[] = "\xE5\x85\xAD\xE6\x9C\x88";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -46,7 +48,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"June"; const wchar_t in[] = L"June";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"juin"; const wchar_t in[] = L"juin";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"\x438\x44E\x43D\x44F"; const wchar_t in[] = L"\x438\x44E\x43D\x44F";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -76,7 +78,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"\x516D\x6708"; const wchar_t in[] = L"\x516D\x6708";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -18,6 +18,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "Sat Dec 31 23:55:59 2061"; const char in[] = "Sat Dec 31 23:55:59 2061";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -52,7 +54,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "23:55:59"; const char in[] = "23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -64,7 +66,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "Sam 31 d""\xC3\xA9""c 23:55:59 2061"; const char in[] = "Sam 31 d""\xC3\xA9""c 23:55:59 2061";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -80,7 +82,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "23:55:59"; const char in[] = "23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -92,7 +94,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD1\x81\xD1\x83\xD0\xB1\xD0\xB1" const char in[] = "\xD1\x81\xD1\x83\xD0\xB1\xD0\xB1"
"\xD0\xBE\xD1\x82\xD0\xB0" "\xD0\xBE\xD1\x82\xD0\xB0"
", 31 " ", 31 "
@ -115,7 +117,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "23:55:59"; const char in[] = "23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -127,7 +129,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE5\x85\xAD" const char in[] = "\xE5\x85\xAD"
" 12/31 23:55:59 2061"; " 12/31 23:55:59 2061";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
@ -144,7 +146,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "23""\xE6\x97\xB6""55""\xE5\x88\x86""59""\xE7\xA7\x92"; const char in[] = "23""\xE6\x97\xB6""55""\xE5\x88\x86""59""\xE7\xA7\x92";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -18,6 +18,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"Sat Dec 31 23:55:59 2061"; const wchar_t in[] = L"Sat Dec 31 23:55:59 2061";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -52,7 +54,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"23:55:59"; const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -64,7 +66,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"Sam 31 d""\xE9""c 23:55:59 2061"; const wchar_t in[] = L"Sam 31 d""\xE9""c 23:55:59 2061";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -80,7 +82,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"23:55:59"; const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -115,7 +117,7 @@ int main()
} }
#endif #endif
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"23:55:59"; const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -144,8 +146,9 @@ int main()
assert(t.tm_wday == 6); assert(t.tm_wday == 6);
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
#endif
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"23""\x65F6""55""\x5206""59""\x79D2"; const wchar_t in[] = L"23""\x65F6""55""\x5206""59""\x79D2";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -156,5 +159,4 @@ int main()
assert(t.tm_hour == 23); assert(t.tm_hour == 23);
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
#endif
} }

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "13:14:15"; const char in[] = "13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "13:14:15"; const char in[] = "13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "13:14:15"; const char in[] = "13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "13:14:15"; const char in[] = "13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"13:14:15"; const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"13:14:15"; const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"13:14:15"; const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"13:14:15"; const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "Monday"; const char in[] = "Monday";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "Lundi"; const char in[] = "Lundi";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5" const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5"
"\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C" "\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
"\xD0\xBD\xD0\xB8\xD0\xBA"; "\xD0\xBD\xD0\xB8\xD0\xBA";
@ -69,7 +71,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE6\x98\x9F\xE6\x9C\x9F\xE4\xB8\x80"; const char in[] = "\xE6\x98\x9F\xE6\x9C\x9F\xE4\xB8\x80";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -19,6 +19,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"Monday"; const wchar_t in[] = L"Monday";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"Lundi"; const wchar_t in[] = L"Lundi";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"\x43F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A"; const wchar_t in[] = L"\x43F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -67,7 +69,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"\x661F\x671F\x4E00"; const wchar_t in[] = L"\x661F\x671F\x4E00";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -18,6 +18,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I; typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F; typedef std::time_get_byname<char, I> F;
@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "2009"; const char in[] = "2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -46,7 +48,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "2009"; const char in[] = "2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "2009"; const char in[] = "2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "2009"; const char in[] = "2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -18,6 +18,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I; typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F; typedef std::time_get_byname<wchar_t, I> F;
@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err; std::ios_base::iostate err;
std::tm t; std::tm t;
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"2009"; const wchar_t in[] = L"2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -46,7 +48,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"2009"; const wchar_t in[] = L"2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("ru_RU.UTF-8", 1); const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"2009"; const wchar_t in[] = L"2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();
@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit); assert(err == std::ios_base::eofbit);
} }
{ {
const my_facet f("zh_CN.UTF-8", 1); const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"2009"; const wchar_t in[] = L"2009";
err = std::ios_base::goodbit; err = std::ios_base::goodbit;
t = std::tm(); t = std::tm();

View File

@ -25,6 +25,8 @@
#include <cassert> #include <cassert>
#include "iterators.h" #include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_put_byname<char, output_iterator<char*> > F; typedef std::time_put_byname<char, output_iterator<char*> > F;
class my_facet class my_facet
@ -51,7 +53,7 @@ int main()
t.tm_isdst = 1; t.tm_isdst = 1;
std::ios ios(0); std::ios ios(0);
{ {
const my_facet f("en_US.UTF-8", 1); const my_facet f(LOCALE_en_US_UTF_8, 1);
std::string pat("Today is %A which is abreviated %a."); std::string pat("Today is %A which is abreviated %a.");
iter = f.put(output_iterator<char*>(str), ios, '*', &t, iter = f.put(output_iterator<char*>(str), ios, '*', &t,
pat.data(), pat.data() + pat.size()); pat.data(), pat.data() + pat.size());
@ -59,7 +61,7 @@ int main()
assert(ex == "Today is Saturday which is abreviated Sat."); assert(ex == "Today is Saturday which is abreviated Sat.");
} }
{ {
const my_facet f("fr_FR.UTF-8", 1); const my_facet f(LOCALE_fr_FR_UTF_8, 1);
std::string pat("Today is %A which is abreviated %a."); std::string pat("Today is %A which is abreviated %a.");
iter = f.put(output_iterator<char*>(str), ios, '*', &t, iter = f.put(output_iterator<char*>(str), ios, '*', &t,
pat.data(), pat.data() + pat.size()); pat.data(), pat.data() + pat.size());

View File

@ -16,6 +16,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -32,7 +34,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@ -45,7 +47,7 @@ int main()
} }
} }
{ {
std::locale l("fr_FR.UTF-8"); std::locale l(LOCALE_fr_FR_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@ -16,6 +16,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -32,7 +34,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@ -45,7 +47,7 @@ int main()
} }
} }
{ {
std::locale l("fr_FR.UTF-8"); std::locale l(LOCALE_fr_FR_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@ -16,6 +16,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -32,7 +34,7 @@ int main()
} }
} }
{ {
std::locale l("en_US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@ -45,7 +47,7 @@ int main()
} }
} }
{ {
std::locale l("fr_FR.UTF-8"); std::locale l(LOCALE_fr_FR_UTF_8);
{ {
typedef char C; typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@ -15,6 +15,8 @@
#include <cassert> #include <cassert>
#include <new> #include <new>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,7 +69,7 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
std::locale loc2; std::locale loc2;
loc2 = loc; loc2 = loc;
assert(loc == loc2); assert(loc == loc2);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,12 +69,12 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc); check(loc);
std::locale loc2("ru_RU.UTF-8"); std::locale loc2(LOCALE_ru_RU_UTF_8);
check(loc2); check(loc2);
assert(loc == loc2); assert(loc == loc2);
std::locale loc3("zh_CN.UTF-8"); std::locale loc3(LOCALE_zh_CN_UTF_8);
check(loc3); check(loc3);
assert(!(loc == loc3)); assert(!(loc == loc3));
assert(loc != loc3); assert(loc != loc3);

View File

@ -15,6 +15,8 @@
#include <cassert> #include <cassert>
#include <new> #include <new>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,7 +69,7 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("fr_FR.UTF-8"); std::locale loc(LOCALE_fr_FR_UTF_8);
std::locale loc2 = loc; std::locale loc2 = loc;
assert(loc == loc2); assert(loc == loc2);
check(loc); check(loc);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -74,13 +76,13 @@ int main()
assert(new_called == 0); assert(new_called == 0);
check(loc); check(loc);
assert(new_called == 0); assert(new_called == 0);
assert(std::locale::global(std::locale("en_US.UTF-8")) == loc); assert(std::locale::global(std::locale(LOCALE_en_US_UTF_8)) == loc);
ok = new_called; ok = new_called;
std::locale loc2; std::locale loc2;
assert(new_called == ok); assert(new_called == ok);
check(loc2); check(loc2);
assert(new_called == ok); assert(new_called == ok);
assert(loc2 == std::locale("en_US.UTF-8")); assert(loc2 == std::locale(LOCALE_en_US_UTF_8));
assert(new_called == ok); assert(new_called == ok);
} }
assert(new_called == ok); assert(new_called == ok);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc); check(loc);
std::locale loc2(loc, "en_US.UTF-8", std::locale::monetary); std::locale loc2(loc, LOCALE_en_US_UTF_8, std::locale::monetary);
check(loc2); check(loc2);
} }
assert(new_called == 0); assert(new_called == 0);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -78,7 +80,7 @@ int main()
{ {
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc); check(loc);
std::locale loc2(loc, new my_facet); std::locale loc2(loc, new my_facet);
check(loc2); check(loc2);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc); check(loc);
std::locale loc2(loc, std::locale("en_US.UTF-8"), std::locale::monetary); std::locale loc2(loc, std::locale(LOCALE_en_US_UTF_8), std::locale::monetary);
check(loc2); check(loc2);
} }
assert(new_called == 0); assert(new_called == 0);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc("ru_RU.UTF-8"); std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc); check(loc);
std::locale loc2(loc, std::string("en_US.UTF-8"), std::locale::monetary); std::locale loc2(loc, std::string(LOCALE_en_US_UTF_8), std::locale::monetary);
check(loc2); check(loc2);
} }
assert(new_called == 0); assert(new_called == 0);

View File

@ -15,6 +15,8 @@
#include <new> #include <new>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0; int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc) void* operator new(std::size_t s) throw(std::bad_alloc)
@ -67,12 +69,12 @@ void check(const std::locale& loc)
int main() int main()
{ {
{ {
std::locale loc(std::string("ru_RU.UTF-8")); std::locale loc(std::string(LOCALE_ru_RU_UTF_8));
check(loc); check(loc);
std::locale loc2(std::string("ru_RU.UTF-8")); std::locale loc2(std::string(LOCALE_ru_RU_UTF_8));
check(loc2); check(loc2);
assert(loc == loc2); assert(loc == loc2);
std::locale loc3(std::string("zh_CN.UTF-8")); std::locale loc3(std::string(LOCALE_zh_CN_UTF_8));
check(loc3); check(loc3);
assert(!(loc == loc3)); assert(!(loc == loc3));
assert(loc != loc3); assert(loc != loc3);

View File

@ -14,6 +14,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -21,7 +23,7 @@ int main()
assert(loc.name() == "C"); assert(loc.name() == "C");
} }
{ {
std::locale loc("en_US.UTF-8"); std::locale loc(LOCALE_en_US_UTF_8);
assert(loc.name() == "en_US.UTF-8"); assert(loc.name() == LOCALE_en_US_UTF_8);
} }
} }

View File

@ -14,12 +14,14 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main() int main()
{ {
std::locale cloc; std::locale cloc;
std::locale copy(cloc); std::locale copy(cloc);
std::locale n1("en_US.UTF-8"); std::locale n1(LOCALE_en_US_UTF_8);
std::locale n2("en_US.UTF-8"); std::locale n2(LOCALE_en_US_UTF_8);
std::locale noname1 = n1.combine<std::ctype<char> >(cloc); std::locale noname1 = n1.combine<std::ctype<char> >(cloc);
std::locale nonamec = noname1; std::locale nonamec = noname1;
std::locale noname2 = n1.combine<std::ctype<char> >(cloc); std::locale noname2 = n1.combine<std::ctype<char> >(cloc);

View File

@ -14,6 +14,8 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../../platform_support.h" // locale name macros
void check(const std::locale& loc) void check(const std::locale& loc)
{ {
assert(std::has_facet<std::collate<char> >(loc)); assert(std::has_facet<std::collate<char> >(loc));
@ -54,8 +56,8 @@ int main()
std::locale loc; std::locale loc;
assert(loc.name() == "C"); assert(loc.name() == "C");
check(loc); check(loc);
assert(std::locale::global(std::locale("en_US.UTF-8")) == loc); assert(std::locale::global(std::locale(LOCALE_en_US_UTF_8)) == loc);
std::locale loc2; std::locale loc2;
check(loc2); check(loc2);
assert(loc2 == std::locale("en_US.UTF-8")); assert(loc2 == std::locale(LOCALE_en_US_UTF_8));
} }

37
test/platform_support.h Normal file
View File

@ -0,0 +1,37 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// Define a bunch of macros that can be used in the tests instead of
// implementation defined assumptions:
// - locale names
// - floating point number string output
#ifndef PLATFORM_SUPPORT_H
#define PLATFORM_SUPPORT_H
// locale names
#if _WIN32
// WARNING: Windows does not support UTF-8 codepages.
// Locales are "converted" using http://docs.moodle.org/dev/Table_of_locales
#define LOCALE_en_US_UTF_8 "English_United States.1252"
#define LOCALE_cs_CZ_ISO8859_2 "Czech_Czech Republic.1250"
#define LOCALE_fr_FR_UTF_8 "French_France.1252"
#define LOCALE_fr_CA_ISO8859_1 "French_Canada.1252"
#define LOCALE_ru_RU_UTF_8 "Russian_Russia.1251"
#define LOCALE_zh_CN_UTF_8 "Chinese_China.936"
#else
#define LOCALE_en_US_UTF_8 "en_US.UTF-8"
#define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO8859-2"
#define LOCALE_fr_FR_UTF_8 "fr_FR.UTF-8"
#define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO8859-1"
#define LOCALE_ru_RU_UTF_8 "ru_RU.UTF-8"
#define LOCALE_zh_CN_UTF_8 "zh_CN.UTF-8"
#endif
#endif // PLATFORM_SUPPORT_H

View File

@ -17,13 +17,15 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../../platform_support.h" // locale name macros
int main() int main()
{ {
std::regex r; std::regex r;
std::locale loc = r.imbue(std::locale("en_US.UTF-8")); std::locale loc = r.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(loc.name() == "C"); assert(loc.name() == "C");
assert(r.getloc().name() == "en_US.UTF-8"); assert(r.getloc().name() == LOCALE_en_US_UTF_8);
loc = r.imbue(std::locale("C")); loc = r.imbue(std::locale("C"));
assert(loc.name() == "en_US.UTF-8"); assert(loc.name() == LOCALE_en_US_UTF_8);
assert(r.getloc().name() == "C"); assert(r.getloc().name() == "C");
} }

View File

@ -17,6 +17,8 @@
#include <regex> #include <regex>
#include <cassert> #include <cassert>
#include "../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -26,10 +28,10 @@ int main()
assert(t2.getloc().name() == "C"); assert(t2.getloc().name() == "C");
} }
{ {
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
std::regex_traits<char> t1; std::regex_traits<char> t1;
assert(t1.getloc().name() == "en_US.UTF-8"); assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
std::regex_traits<wchar_t> t2; std::regex_traits<wchar_t> t2;
assert(t2.getloc().name() == "en_US.UTF-8"); assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
} }
} }

View File

@ -16,6 +16,8 @@
#include <regex> #include <regex>
#include <cassert> #include <cassert>
#include "../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
@ -25,10 +27,10 @@ int main()
assert(t2.getloc().name() == "C"); assert(t2.getloc().name() == "C");
} }
{ {
std::locale::global(std::locale("en_US.UTF-8")); std::locale::global(std::locale(LOCALE_en_US_UTF_8));
std::regex_traits<char> t1; std::regex_traits<char> t1;
assert(t1.getloc().name() == "en_US.UTF-8"); assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
std::regex_traits<wchar_t> t2; std::regex_traits<wchar_t> t2;
assert(t2.getloc().name() == "en_US.UTF-8"); assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
} }
} }

View File

@ -17,12 +17,14 @@
#include <locale> #include <locale>
#include <cassert> #include <cassert>
#include "../../platform_support.h" // locale name macros
int main() int main()
{ {
{ {
std::regex_traits<char> t; std::regex_traits<char> t;
std::locale loc = t.imbue(std::locale("en_US.UTF-8")); std::locale loc = t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(loc.name() == "C"); assert(loc.name() == "C");
assert(t.getloc().name() == "en_US.UTF-8"); assert(t.getloc().name() == LOCALE_en_US_UTF_8);
} }
} }

View File

@ -17,6 +17,8 @@
#include <regex> #include <regex>
#include <cassert> #include <cassert>
#include "../../platform_support.h"
int main() int main()
{ {
{ {
@ -29,7 +31,7 @@ int main()
assert(t.translate_nocase('1') == '1'); assert(t.translate_nocase('1') == '1');
assert(t.translate_nocase('\xDA') == '\xDA'); assert(t.translate_nocase('\xDA') == '\xDA');
assert(t.translate_nocase('\xFA') == '\xFA'); assert(t.translate_nocase('\xFA') == '\xFA');
t.imbue(std::locale("en_US.UTF-8")); t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(t.translate_nocase(' ') == ' '); assert(t.translate_nocase(' ') == ' ');
assert(t.translate_nocase('A') == 'a'); assert(t.translate_nocase('A') == 'a');
assert(t.translate_nocase('\x07') == '\x07'); assert(t.translate_nocase('\x07') == '\x07');
@ -49,7 +51,7 @@ int main()
assert(t.translate_nocase(L'1') == L'1'); assert(t.translate_nocase(L'1') == L'1');
assert(t.translate_nocase(L'\xDA') == L'\xDA'); assert(t.translate_nocase(L'\xDA') == L'\xDA');
assert(t.translate_nocase(L'\xFA') == L'\xFA'); assert(t.translate_nocase(L'\xFA') == L'\xFA');
t.imbue(std::locale("en_US.UTF-8")); t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(t.translate_nocase(L' ') == L' '); assert(t.translate_nocase(L' ') == L' ');
assert(t.translate_nocase(L'A') == L'a'); assert(t.translate_nocase(L'A') == L'a');
assert(t.translate_nocase(L'\x07') == L'\x07'); assert(t.translate_nocase(L'\x07') == L'\x07');