diff options
author | Howard Hinnant <hhinnant@apple.com> | 2011-10-03 15:23:59 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2011-10-03 15:23:59 +0000 |
commit | 33a30f4159ba82ec90188be9e9e1431e62780c0f (patch) | |
tree | 3a8d4cae9b39b6786cc0447ce9dd2868effe0c8d /libcxx | |
parent | 70107f989c2e62372b5adc310a95be668b7cb33b (diff) | |
download | bcm5719-llvm-33a30f4159ba82ec90188be9e9e1431e62780c0f.tar.gz bcm5719-llvm-33a30f4159ba82ec90188be9e9e1431e62780c0f.zip |
Windows porting work by Ruben Van Boxem
llvm-svn: 141003
Diffstat (limited to 'libcxx')
90 files changed, 558 insertions, 343 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp index 2bf60aa9d34..24d130cd8ea 100644 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp @@ -16,6 +16,8 @@ #include <fstream> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + template <class CharT> struct test_buf : public std::basic_filebuf<CharT> @@ -115,7 +117,7 @@ int main() std::remove("overflow.dat"); { 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.sputc(0x4E51) == 0x4E51); assert(f.sputc(0x4E52) == 0x4E52); diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp index 670a254ec8e..af6c651815c 100644 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp @@ -16,6 +16,8 @@ #include <fstream> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + template <class CharT> struct test_buf : public std::basic_filebuf<CharT> @@ -108,7 +110,7 @@ int main() } { 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.is_open()); assert(f.sbumpc() == 0x4E51); diff --git a/libcxx/test/input.output/iostream.format/ext.manip/get_money.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/get_money.pass.cpp index 8230fe92760..297319c1546 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/get_money.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/get_money.pass.cpp @@ -14,6 +14,8 @@ #include <iomanip> #include <cassert> +#include "../../../platform_support.h" // locale name macros + template <class CharT> struct testbuf : public std::basic_streambuf<CharT> @@ -39,7 +41,7 @@ int main() { testbuf<char> sb(" -$1,234,567.89"); 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; is >> std::get_money(x, false); assert(x == -123456789); @@ -47,7 +49,7 @@ int main() { testbuf<char> sb(" -USD 1,234,567.89"); 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; is >> std::get_money(x, true); assert(x == -123456789); @@ -55,7 +57,7 @@ int main() { testbuf<wchar_t> sb(L" -$1,234,567.89"); 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; is >> std::get_money(x, false); assert(x == -123456789); @@ -63,7 +65,7 @@ int main() { testbuf<wchar_t> sb(L" -USD 1,234,567.89"); 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; is >> std::get_money(x, true); assert(x == -123456789); diff --git a/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp index 9804015a7bf..825b9959d02 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp @@ -14,6 +14,8 @@ #include <iomanip> #include <cassert> +#include "../../../platform_support.h" // locale name macros + template <class CharT> struct testbuf : public std::basic_streambuf<CharT> @@ -39,7 +41,7 @@ int main() { testbuf<char> sb(" Sat Dec 31 23:55:59 2061"); 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}; is >> std::get_time(&t, "%c"); assert(t.tm_sec == 59); @@ -55,7 +57,7 @@ int main() { testbuf<wchar_t> sb(L" Sat Dec 31 23:55:59 2061"); 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}; is >> std::get_time(&t, L"%c"); assert(t.tm_sec == 59); diff --git a/libcxx/test/input.output/iostream.format/ext.manip/put_money.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/put_money.pass.cpp index 0b06818957e..e6d3d3891fc 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/put_money.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/put_money.pass.cpp @@ -14,6 +14,8 @@ #include <iomanip> #include <cassert> +#include "../../../platform_support.h" // locale name macros + template <class CharT> class testbuf : public std::basic_streambuf<CharT> @@ -51,7 +53,7 @@ int main() { testbuf<char> sb; std::ostream os(&sb); - os.imbue(std::locale("en_US.UTF-8")); + os.imbue(std::locale(LOCALE_en_US_UTF_8)); showbase(os); long double x = -123456789; os << std::put_money(x, false); @@ -60,7 +62,7 @@ int main() { testbuf<char> sb; std::ostream os(&sb); - os.imbue(std::locale("en_US.UTF-8")); + os.imbue(std::locale(LOCALE_en_US_UTF_8)); showbase(os); long double x = -123456789; os << std::put_money(x, true); @@ -69,7 +71,7 @@ int main() { testbuf<wchar_t> sb; std::wostream os(&sb); - os.imbue(std::locale("en_US.UTF-8")); + os.imbue(std::locale(LOCALE_en_US_UTF_8)); showbase(os); long double x = -123456789; os << std::put_money(x, false); @@ -78,7 +80,7 @@ int main() { testbuf<wchar_t> sb; std::wostream os(&sb); - os.imbue(std::locale("en_US.UTF-8")); + os.imbue(std::locale(LOCALE_en_US_UTF_8)); showbase(os); long double x = -123456789; os << std::put_money(x, true); diff --git a/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp index 9f5710d9153..ca4d7e13072 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp @@ -14,6 +14,8 @@ #include <iomanip> #include <cassert> +#include "../../../platform_support.h" // locale name macros + template <class CharT> class testbuf : public std::basic_streambuf<CharT> @@ -51,7 +53,7 @@ int main() { testbuf<char> 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}; t.tm_sec = 59; t.tm_min = 55; @@ -66,7 +68,7 @@ int main() { testbuf<wchar_t> 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}; t.tm_sec = 59; t.tm_min = 55; diff --git a/libcxx/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp b/libcxx/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp index bb6750249bc..db5781130d4 100644 --- a/libcxx/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp @@ -18,6 +18,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class test : 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) { - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 4); ++f1_called; } @@ -47,6 +49,6 @@ int main() 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); } diff --git a/libcxx/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp b/libcxx/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp index eb508f044b8..66bf829775b 100644 --- a/libcxx/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp @@ -18,6 +18,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class test : public std::ios { @@ -39,7 +41,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert( f2_called); assert( f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 4); f1_called = true; } @@ -52,7 +54,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert(!f2_called); assert( f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 5); f2_called = true; } @@ -65,7 +67,7 @@ void f3(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert(!f2_called); assert(!f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 6); f3_called = true; } @@ -78,9 +80,9 @@ int main() b.register_callback(f1, 4); b.register_callback(f2, 5); 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(b.getloc().name() == std::string("en_US.UTF-8")); + assert(b.getloc().name() == std::string(LOCALE_en_US_UTF_8)); assert(f1_called); assert(f2_called); assert(f3_called); diff --git a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp index 74cac053034..95048deda9c 100644 --- a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + struct testbuf : public std::streambuf { @@ -38,7 +40,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index) assert(!g1_called); assert(!g2_called); assert(!g3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 4); f1_called = true; } @@ -53,7 +55,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index) assert(!g1_called); assert(!g2_called); assert(!g3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 5); f2_called = true; } @@ -68,7 +70,7 @@ void g1(std::ios_base::event ev, std::ios_base& stream, int index) assert(!g1_called); assert( g2_called); assert( g3_called); - assert(stream.getloc().name() == "fr_FR.UTF-8"); + assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8); assert(index == 7); g1_called = true; } @@ -83,7 +85,7 @@ void g2(std::ios_base::event ev, std::ios_base& stream, int index) assert(!g1_called); assert(!g2_called); assert( g3_called); - assert(stream.getloc().name() == "fr_FR.UTF-8"); + assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8); assert(index == 8); g2_called = true; } @@ -98,7 +100,7 @@ void g3(std::ios_base::event ev, std::ios_base& stream, int index) assert(!g1_called); assert(!g2_called); assert(!g3_called); - assert(stream.getloc().name() == "fr_FR.UTF-8"); + assert(stream.getloc().name() == LOCALE_fr_FR_UTF_8); assert(index == 9); g3_called = true; } @@ -111,7 +113,7 @@ int main() ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed); ios1.precision(1); 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.setstate(std::ios::eofbit); ios1.register_callback(f1, 4); @@ -131,7 +133,7 @@ int main() ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.precision(2); 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.setstate(std::ios::goodbit); ios2.register_callback(g1, 7); @@ -165,7 +167,7 @@ int main() assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.precision() == 2); 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(f1_called); assert(f2_called); diff --git a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp index ed022ca41f0..33c32a79da4 100644 --- a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + struct testbuf : public std::streambuf { @@ -33,7 +35,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert( f2_called); assert( f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 4); f1_called = true; } @@ -46,7 +48,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert(!f2_called); assert( f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 5); f2_called = true; } @@ -59,7 +61,7 @@ void f3(std::ios_base::event ev, std::ios_base& stream, int index) assert(!f1_called); assert(!f2_called); assert(!f3_called); - assert(stream.getloc().name() == "en_US.UTF-8"); + assert(stream.getloc().name() == LOCALE_en_US_UTF_8); assert(index == 6); f3_called = true; } @@ -72,9 +74,9 @@ int main() ios.register_callback(f1, 4); ios.register_callback(f2, 5); 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(ios.getloc().name() == std::string("en_US.UTF-8")); + assert(ios.getloc().name() == std::string(LOCALE_en_US_UTF_8)); assert(f1_called); assert(f2_called); assert(f3_called); @@ -88,10 +90,10 @@ int main() ios.register_callback(f1, 4); ios.register_callback(f2, 5); 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(ios.getloc().name() == std::string("en_US.UTF-8")); - assert(sb.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(LOCALE_en_US_UTF_8)); assert(f1_called); assert(f2_called); assert(f3_called); diff --git a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp index 213b0f84590..647606da856 100644 --- a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + struct testbuf : public std::streambuf { @@ -82,7 +84,7 @@ int main() ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.precision(2); 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.setstate(std::ios::goodbit); ios2.register_callback(g1, 7); @@ -107,7 +109,7 @@ int main() assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.precision() == 2); 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(!f1_called); assert(!f2_called); diff --git a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp index 5de9229e4fa..5a59b350c7e 100644 --- a/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp +++ b/libcxx/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + struct testbuf : public std::streambuf { @@ -73,7 +75,7 @@ int main() ios1.flags(std::ios::boolalpha | std::ios::dec | std::ios::fixed); ios1.precision(1); 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.setstate(std::ios::eofbit); ios1.register_callback(f1, 4); @@ -93,7 +95,7 @@ int main() ios2.flags(std::ios::showpoint | std::ios::uppercase); ios2.precision(2); 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.setstate(std::ios::goodbit); ios2.register_callback(g1, 7); @@ -118,7 +120,7 @@ int main() assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase)); assert(ios1.precision() == 2); 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(!f1_called); assert(!f2_called); @@ -147,7 +149,7 @@ int main() assert(ios2.flags() == (std::ios::boolalpha | std::ios::dec | std::ios::fixed)); assert(ios2.precision() == 1); 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.iword(0) == 1); assert(ios2.iword(1) == 2); diff --git a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp index ffad159f8f8..8af132e5be6 100644 --- a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp +++ b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + template <class CharT> struct test : public std::basic_streambuf<CharT> @@ -70,7 +72,7 @@ int main() t.setp(&p1, &p3); 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> t2 = t; diff --git a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp index f8f3b801023..3869c0bcf00 100644 --- a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp +++ b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + template <class CharT> struct test : public std::basic_streambuf<CharT> @@ -42,13 +44,13 @@ int main() test<wchar_t> t; 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; - assert(t.getloc().name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } { test<wchar_t> t; - assert(t.getloc().name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp index 637fcbe8e13..2b8181f5011 100644 --- a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp +++ b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp @@ -18,6 +18,8 @@ #include <streambuf> #include <cassert> +#include "../../../../../platform_support.h" // locale name macros + template <class CharT> struct test : public std::basic_streambuf<CharT> @@ -26,7 +28,7 @@ struct test 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; 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; - assert(t.getloc().name() == "en_US.UTF-8"); - assert(t.pubimbue(std::locale("fr_FR.UTF-8")).name() == "en_US.UTF-8"); - assert(t.getloc().name() == "fr_FR.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); + assert(t.pubimbue(std::locale(LOCALE_fr_FR_UTF_8)).name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_fr_FR_UTF_8); } } diff --git a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp index def79eef44e..bde1676777c 100644 --- a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp +++ b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../../platform_support.h" // locale name macros + template <class CharT> struct test : public std::basic_streambuf<CharT> @@ -75,7 +77,7 @@ int main() test<wchar_t> t2; 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> t2; diff --git a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp index 0b33d33671f..9a07e9496ad 100644 --- a/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp +++ b/libcxx/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp @@ -17,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "../../../../../platform_support.h" // locale name macros + template <class CharT> struct test : public std::basic_streambuf<CharT> @@ -85,7 +87,7 @@ int main() test<wchar_t> t2; 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> t2; diff --git a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp index 0e5d581ec1b..f564adaea88 100644 --- a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp @@ -24,10 +24,12 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + 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); std::string s2("aaaaaaA"); diff --git a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp index 0ba8d03b0ce..9ebf2f98416 100644 --- a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp @@ -19,9 +19,11 @@ #include <string> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { std::string x1("1234"); std::string x2("12345"); diff --git a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp index cd94c0fca8d..70898d17db7 100644 --- a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp @@ -19,12 +19,14 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + int main() { // 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"); const std::collate<char>& f = std::use_facet<std::collate<char> >(l); diff --git a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp index 50e803313f5..021d92d4ab9 100644 --- a/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp @@ -27,9 +27,11 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + 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::use_facet<std::collate<char> >(l) diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp index f76232f71fc..736be10cf56 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp @@ -17,6 +17,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> F; class my_facet @@ -38,12 +40,12 @@ int my_facet::count = 0; 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 == 0); { - my_facet f("en_US.UTF-8", 1); + my_facet f(LOCALE_en_US_UTF_8, 1); assert(my_facet::count == 1); { std::locale l(std::locale::classic(), &f); @@ -53,12 +55,12 @@ int main() } 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 == 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); { std::locale l(std::locale::classic(), &f); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp index e6da3203851..ec6b95bfb6d 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp @@ -17,10 +17,12 @@ #include <type_traits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp index 4f3b0abf417..e573574ca55 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp @@ -20,10 +20,12 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp index 4885290ef68..c1edbfaf0b9 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp @@ -16,10 +16,12 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + 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; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp index 77688198e69..1a758013dfe 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp @@ -18,10 +18,12 @@ #include <vector> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("fr_CA.ISO8859-1"); + std::locale l(LOCALE_fr_CA_ISO8859_1); { typedef std::ctype<wchar_t> F; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp index a758f5146b9..d3da67e29a7 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp @@ -20,10 +20,12 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp index b53a16a55da..603c33ad531 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp @@ -20,10 +20,12 @@ #include <stdio.h> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp index 3e8908bbeef..e5c76c8b879 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp @@ -16,10 +16,12 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<char> F; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp index 3fbd46fcd7f..11eba5293bf 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp @@ -17,10 +17,12 @@ #include <string> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<char> F; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp index 495b2020d4a..e31a808eb8d 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp @@ -16,10 +16,12 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<char> F; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp index b5a899921d7..6a6c9ef5d8a 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp @@ -17,10 +17,12 @@ #include <string> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<char> F; 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; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp index bb6c73c99c8..aaa5fe962e5 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp @@ -25,10 +25,12 @@ #include <type_traits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + 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::use_facet<std::ctype<char> >(l) diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp index b45971fe6f3..022a595007c 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp @@ -19,10 +19,12 @@ #include <cassert> #include <limits.h> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp index 59bf3e366d5..bf229596104 100644 --- a/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp @@ -20,10 +20,12 @@ #include <vector> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { - std::locale l("en_US.UTF-8"); + std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype<wchar_t> F; const F& f = std::use_facet<F>(l); diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp index d4dfbd1e31b..2340336c369 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get<char, input_iterator<const char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp index 7596099fef5..6da2527e501 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get<char, input_iterator<const char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp index 5cfc8bdb2d8..041156d37e1 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get<char, input_iterator<const char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp index 15042d972a6..3a0097343f2 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get<char, input_iterator<const char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp index c9984c84a75..3ec5c57a5ab 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get<char, input_iterator<const char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp index 6f359ab2f5b..e6672880df5 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put<char, output_iterator<char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp index 32eb081b4a0..c724c2395d5 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put<char, output_iterator<char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp index 879ae4e2e59..0e593e616b4 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put<char, output_iterator<char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp index 3f08d2f74c5..5cf4b526d05 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put<char, output_iterator<char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp index cbbeeab5d44..30f0b2d62ca 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp @@ -20,6 +20,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put<char, output_iterator<char*> > Fn; class my_facet @@ -43,7 +45,7 @@ public: int main() { 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(), new std::moneypunct_byname<char, false>(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp index f6554a22c0d..e53711aae2e 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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() == "$"); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); 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"$"); } { - Fwt f("en_US.UTF-8", 1); + Fwt f(LOCALE_en_US_UTF_8, 1); 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"); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); 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"); } { - Fwt f("fr_FR.UTF-8", 1); + Fwt f(LOCALE_fr_FR_UTF_8, 1); 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""."); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); 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""."); } { - Fwt f("ru_RU.UTF-8", 1); + Fwt f(LOCALE_ru_RU_UTF_8, 1); 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"); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); 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"); } { - Fwt f("zh_CN.UTF-8", 1); + Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.curr_symbol() == L"CNY "); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp index 47ba877d08f..9e6a629b8f1 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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() == '.'); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.decimal_point() == '.'); } { - Fwf f("en_US.UTF-8", 1); + Fwf f(LOCALE_en_US_UTF_8, 1); 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'.'); } { - Fnf f("fr_FR.UTF-8", 1); + Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.decimal_point() == ','); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.decimal_point() == ','); } { - Fwf f("fr_FR.UTF-8", 1); + Fwf f(LOCALE_fr_FR_UTF_8, 1); 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','); } { - Fnf f("ru_RU.UTF-8", 1); + Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.decimal_point() == ','); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.decimal_point() == ','); } { - Fwf f("ru_RU.UTF-8", 1); + Fwf f(LOCALE_ru_RU_UTF_8, 1); 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','); } { - Fnf f("zh_CN.UTF-8", 1); + Fnf f(LOCALE_zh_CN_UTF_8, 1); assert(f.decimal_point() == '.'); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.decimal_point() == '.'); } { - Fwf f("zh_CN.UTF-8", 1); + Fwf f(LOCALE_zh_CN_UTF_8, 1); 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'.'); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp index f30f004a74c..7893d21d173 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); 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); } { - Fwt f("en_US.UTF-8", 1); + Fwt f(LOCALE_en_US_UTF_8, 1); 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); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); 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); } { - Fwt f("fr_FR.UTF-8", 1); + Fwt f(LOCALE_fr_FR_UTF_8, 1); 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); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); 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); } { - Fwt f("ru_RU.UTF-8", 1); + Fwt f(LOCALE_ru_RU_UTF_8, 1); 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); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); 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); } { - Fwt f("zh_CN.UTF-8", 1); + Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.frac_digits() == 2); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp index 14edf6923be..7802fafc1e6 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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"); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); 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"); } { - Fwt f("en_US.UTF-8", 1); + Fwt f(LOCALE_en_US_UTF_8, 1); 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"); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); 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"); } { - Fwt f("fr_FR.UTF-8", 1); + Fwt f(LOCALE_fr_FR_UTF_8, 1); 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"); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); 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"); } { - Fwt f("ru_RU.UTF-8", 1); + Fwt f(LOCALE_ru_RU_UTF_8, 1); 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"); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); 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"); } { - Fwt f("zh_CN.UTF-8", 1); + Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.grouping() == "\3\3"); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp index 027044ddf4c..fc2165a67a0 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -93,7 +95,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -101,7 +103,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -109,7 +111,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); 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(); assert(p.field[0] == std::money_base::value); assert(p.field[1] == std::money_base::space); @@ -126,7 +128,7 @@ int main() 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(); assert(p.field[0] == std::money_base::value); assert(p.field[1] == std::money_base::space); @@ -134,7 +136,7 @@ int main() 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(); assert(p.field[0] == std::money_base::value); assert(p.field[1] == std::money_base::space); @@ -142,7 +144,7 @@ int main() 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(); assert(p.field[0] == std::money_base::value); 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -159,7 +161,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -167,7 +169,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -175,7 +177,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); 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(); assert(p.field[0] == std::money_base::symbol); assert(p.field[1] == std::money_base::sign); @@ -192,7 +194,7 @@ int main() 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(); assert(p.field[0] == std::money_base::symbol); assert(p.field[1] == std::money_base::sign); @@ -200,7 +202,7 @@ int main() 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(); assert(p.field[0] == std::money_base::symbol); assert(p.field[1] == std::money_base::sign); @@ -208,7 +210,7 @@ int main() 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(); assert(p.field[0] == std::money_base::symbol); assert(p.field[1] == std::money_base::sign); diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp index 4b78c77f94c..a84c3c62d5b 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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() == "-"); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fwf f("en_US.UTF-8", 1); + Fwf f(LOCALE_en_US_UTF_8, 1); 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"-"); } { - Fnf f("fr_FR.UTF-8", 1); + Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fwf f("fr_FR.UTF-8", 1); + Fwf f(LOCALE_fr_FR_UTF_8, 1); 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"-"); } { - Fnf f("ru_RU.UTF-8", 1); + Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fwf f("ru_RU.UTF-8", 1); + Fwf f(LOCALE_ru_RU_UTF_8, 1); 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"-"); } { - Fnf f("zh_CN.UTF-8", 1); + Fnf f(LOCALE_zh_CN_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.negative_sign() == "-"); } { - Fwf f("zh_CN.UTF-8", 1); + Fwf f(LOCALE_zh_CN_UTF_8, 1); 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"-"); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp index 325a5a1b806..21e7d0335a2 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -93,7 +95,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -101,7 +103,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -109,7 +111,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -126,7 +128,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -134,7 +136,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -142,7 +144,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -159,7 +161,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -167,7 +169,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::value); @@ -175,7 +177,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -192,7 +194,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -200,7 +202,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); @@ -208,7 +210,7 @@ int main() 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(); assert(p.field[0] == std::money_base::sign); assert(p.field[1] == std::money_base::symbol); diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp index d9107f4cef0..59990dd1163 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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() == ""); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fwf f("en_US.UTF-8", 1); + Fwf f(LOCALE_en_US_UTF_8, 1); 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""); } { - Fnf f("fr_FR.UTF-8", 1); + Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fwf f("fr_FR.UTF-8", 1); + Fwf f(LOCALE_fr_FR_UTF_8, 1); 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""); } { - Fnf f("ru_RU.UTF-8", 1); + Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fwf f("ru_RU.UTF-8", 1); + Fwf f(LOCALE_ru_RU_UTF_8, 1); 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""); } { - Fnf f("zh_CN.UTF-8", 1); + Fnf f(LOCALE_zh_CN_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.positive_sign() == ""); } { - Fwf f("zh_CN.UTF-8", 1); + Fwf f(LOCALE_zh_CN_UTF_8, 1); 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""); } } diff --git a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp index bc9e0a920e4..92b0369023b 100644 --- a/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -17,6 +17,8 @@ #include <limits> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + class Fnf : 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() == ','); } { - Fnt f("en_US.UTF-8", 1); + Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.thousands_sep() == ','); } { - Fwf f("en_US.UTF-8", 1); + Fwf f(LOCALE_en_US_UTF_8, 1); 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','); } { - Fnf f("fr_FR.UTF-8", 1); + Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); } { - Fnt f("fr_FR.UTF-8", 1); + Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); } { - Fwf f("fr_FR.UTF-8", 1); + Fwf f(LOCALE_fr_FR_UTF_8, 1); 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' '); } { - Fnf f("ru_RU.UTF-8", 1); + Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } { - Fnt f("ru_RU.UTF-8", 1); + Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == ' '); } { - Fwf f("ru_RU.UTF-8", 1); + Fwf f(LOCALE_ru_RU_UTF_8, 1); 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' '); } { - Fnf f("zh_CN.UTF-8", 1); + Fnf f(LOCALE_zh_CN_UTF_8, 1); assert(f.thousands_sep() == ','); } { - Fnt f("zh_CN.UTF-8", 1); + Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.thousands_sep() == ','); } { - Fwf f("zh_CN.UTF-8", 1); + Fwf f(LOCALE_zh_CN_UTF_8, 1); 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','); } } diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp index d250c257832..b6d7d09dbcd 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp @@ -17,6 +17,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_get_byname<char, input_iterator<const char*> > F; class my_facet @@ -30,19 +32,19 @@ public: 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); } { - 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); } { - 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); } { - 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); } } diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp index 8f3dc704c21..9f8e8ad06ee 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp @@ -17,6 +17,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F; class my_facet @@ -30,19 +32,19 @@ public: 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); } { - 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); } { - 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); } { - 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); } } diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp index 8dbe5312329..84ff3c9fa7f 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -49,7 +51,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -61,7 +63,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -73,7 +75,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp index 9969f597594..68c148fec25 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -49,7 +51,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -61,7 +63,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -73,7 +75,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp index 6e2448406d1..5d7bafb2bbc 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -47,7 +49,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -57,7 +59,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -67,7 +69,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp index 5fdd23b18ed..6909123c06f 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -46,7 +48,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -56,7 +58,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -66,7 +68,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -76,7 +78,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp index cba5a6b7c46..07d36c83ac6 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp @@ -18,6 +18,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -36,7 +38,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -52,7 +54,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -64,7 +66,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -80,7 +82,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -92,7 +94,7 @@ int main() 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" "\xD0\xBE\xD1\x82\xD0\xB0" ", 31 " @@ -115,7 +117,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -127,7 +129,7 @@ int main() 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" " 12/31 23:55:59 2061"; err = std::ios_base::goodbit; @@ -144,7 +146,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp index 7e4f24276a7..2d5b9412d8b 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp @@ -18,6 +18,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -36,7 +38,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -52,7 +54,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -64,7 +66,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -80,7 +82,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -115,7 +117,7 @@ int main() } #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"; err = std::ios_base::goodbit; t = std::tm(); @@ -144,8 +146,9 @@ int main() assert(t.tm_wday == 6); 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -156,5 +159,4 @@ int main() assert(t.tm_hour == 23); assert(err == std::ios_base::eofbit); } -#endif } diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp index 019abde8814..425fa399ae3 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -49,7 +51,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -61,7 +63,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -73,7 +75,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp index 6cf658f1c59..6cf2abb53b9 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -49,7 +51,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -61,7 +63,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -73,7 +75,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp index c993e655690..fb50ae83dc7 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -47,7 +49,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -57,7 +59,7 @@ int main() 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" "\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C" "\xD0\xBD\xD0\xB8\xD0\xBA"; @@ -69,7 +71,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp index fe804e7dcee..169b192082f 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp @@ -19,6 +19,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -37,7 +39,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -47,7 +49,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -57,7 +59,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -67,7 +69,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp index fd0f18bd0c1..546110432f9 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp @@ -18,6 +18,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const char*> I; typedef std::time_get_byname<char, I> F; @@ -36,7 +38,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -46,7 +48,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -56,7 +58,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -66,7 +68,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp index f598037d5cb..0361bb03008 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp @@ -18,6 +18,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator<const wchar_t*> I; typedef std::time_get_byname<wchar_t, I> F; @@ -36,7 +38,7 @@ int main() std::ios_base::iostate err; 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -46,7 +48,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -56,7 +58,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); @@ -66,7 +68,7 @@ int main() 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"; err = std::ios_base::goodbit; t = std::tm(); diff --git a/libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp b/libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp index 3df454eefd2..00334616755 100644 --- a/libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp @@ -25,6 +25,8 @@ #include <cassert> #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_put_byname<char, output_iterator<char*> > F; class my_facet @@ -51,7 +53,7 @@ int main() t.tm_isdst = 1; 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."); iter = f.put(output_iterator<char*>(str), ios, '*', &t, pat.data(), pat.data() + pat.size()); @@ -59,7 +61,7 @@ int main() 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."); iter = f.put(output_iterator<char*>(str), ios, '*', &t, pat.data(), pat.data() + pat.size()); diff --git a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp index 3acd317e1b7..fbfd189ccf3 100644 --- a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp +++ b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp @@ -16,6 +16,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + 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; 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; const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); diff --git a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp index 5e9e46769b0..ec0ed36a582 100644 --- a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp +++ b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp @@ -16,6 +16,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + 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; 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; const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); diff --git a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp index b94cee4a0b4..10eebffed3c 100644 --- a/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp +++ b/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp @@ -16,6 +16,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + 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; 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; const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); diff --git a/libcxx/test/localization/locales/locale/locale.cons/assign.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/assign.pass.cpp index 27f851c9377..b6fcf3e73e6 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/assign.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/assign.pass.cpp @@ -15,6 +15,8 @@ #include <cassert> #include <new> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,7 +69,7 @@ void check(const std::locale& loc) int main() { { - std::locale loc("ru_RU.UTF-8"); + std::locale loc(LOCALE_ru_RU_UTF_8); std::locale loc2; loc2 = loc; assert(loc == loc2); diff --git a/libcxx/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp index 30268a41320..737da285dd7 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,12 +69,12 @@ void check(const std::locale& loc) int main() { { - std::locale loc("ru_RU.UTF-8"); + std::locale loc(LOCALE_ru_RU_UTF_8); check(loc); - std::locale loc2("ru_RU.UTF-8"); + std::locale loc2(LOCALE_ru_RU_UTF_8); check(loc2); assert(loc == loc2); - std::locale loc3("zh_CN.UTF-8"); + std::locale loc3(LOCALE_zh_CN_UTF_8); check(loc3); assert(!(loc == loc3)); assert(loc != loc3); diff --git a/libcxx/test/localization/locales/locale/locale.cons/copy.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/copy.pass.cpp index fa8631caabc..03845757d26 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/copy.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/copy.pass.cpp @@ -15,6 +15,8 @@ #include <cassert> #include <new> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,7 +69,7 @@ void check(const std::locale& loc) int main() { { - std::locale loc("fr_FR.UTF-8"); + std::locale loc(LOCALE_fr_FR_UTF_8); std::locale loc2 = loc; assert(loc == loc2); check(loc); diff --git a/libcxx/test/localization/locales/locale/locale.cons/default.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/default.pass.cpp index 3ea1ff1fb6a..9a7809fc7f8 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/default.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/default.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -74,13 +76,13 @@ int main() assert(new_called == 0); check(loc); 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; std::locale loc2; assert(new_called == ok); check(loc2); 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); diff --git a/libcxx/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp index 7aa05490303..0e6c071c663 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,9 +69,9 @@ void check(const std::locale& loc) int main() { { - std::locale loc("ru_RU.UTF-8"); + std::locale loc(LOCALE_ru_RU_UTF_8); 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); } assert(new_called == 0); diff --git a/libcxx/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp index 868df624ffc..e8016f48b2b 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; 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); std::locale loc2(loc, new my_facet); check(loc2); diff --git a/libcxx/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp index 4dc7744f0c4..586febb02be 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,9 +69,9 @@ void check(const std::locale& loc) int main() { { - std::locale loc("ru_RU.UTF-8"); + std::locale loc(LOCALE_ru_RU_UTF_8); 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); } assert(new_called == 0); diff --git a/libcxx/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp index 6650d54487f..3b43e70e569 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,9 +69,9 @@ void check(const std::locale& loc) int main() { { - std::locale loc("ru_RU.UTF-8"); + std::locale loc(LOCALE_ru_RU_UTF_8); 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); } assert(new_called == 0); diff --git a/libcxx/test/localization/locales/locale/locale.cons/string.pass.cpp b/libcxx/test/localization/locales/locale/locale.cons/string.pass.cpp index f831f9f87dd..8cfeccf78fe 100644 --- a/libcxx/test/localization/locales/locale/locale.cons/string.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.cons/string.pass.cpp @@ -15,6 +15,8 @@ #include <new> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) @@ -67,12 +69,12 @@ void check(const std::locale& loc) int main() { { - std::locale loc(std::string("ru_RU.UTF-8")); + std::locale loc(std::string(LOCALE_ru_RU_UTF_8)); check(loc); - std::locale loc2(std::string("ru_RU.UTF-8")); + std::locale loc2(std::string(LOCALE_ru_RU_UTF_8)); check(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); assert(!(loc == loc3)); assert(loc != loc3); diff --git a/libcxx/test/localization/locales/locale/locale.members/name.pass.cpp b/libcxx/test/localization/locales/locale/locale.members/name.pass.cpp index 3092d8acc63..9948854fa56 100644 --- a/libcxx/test/localization/locales/locale/locale.members/name.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.members/name.pass.cpp @@ -14,6 +14,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { { @@ -21,7 +23,7 @@ int main() assert(loc.name() == "C"); } { - std::locale loc("en_US.UTF-8"); - assert(loc.name() == "en_US.UTF-8"); + std::locale loc(LOCALE_en_US_UTF_8); + assert(loc.name() == LOCALE_en_US_UTF_8); } } diff --git a/libcxx/test/localization/locales/locale/locale.operators/eq.pass.cpp b/libcxx/test/localization/locales/locale/locale.operators/eq.pass.cpp index 0a671cc2645..b3cf68e3b41 100644 --- a/libcxx/test/localization/locales/locale/locale.operators/eq.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.operators/eq.pass.cpp @@ -14,12 +14,14 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + int main() { std::locale cloc; std::locale copy(cloc); - std::locale n1("en_US.UTF-8"); - std::locale n2("en_US.UTF-8"); + std::locale n1(LOCALE_en_US_UTF_8); + std::locale n2(LOCALE_en_US_UTF_8); std::locale noname1 = n1.combine<std::ctype<char> >(cloc); std::locale nonamec = noname1; std::locale noname2 = n1.combine<std::ctype<char> >(cloc); diff --git a/libcxx/test/localization/locales/locale/locale.statics/global.pass.cpp b/libcxx/test/localization/locales/locale/locale.statics/global.pass.cpp index 74a4a843f4c..ca73505d37c 100644 --- a/libcxx/test/localization/locales/locale/locale.statics/global.pass.cpp +++ b/libcxx/test/localization/locales/locale/locale.statics/global.pass.cpp @@ -14,6 +14,8 @@ #include <locale> #include <cassert> +#include "../../../../platform_support.h" // locale name macros + void check(const std::locale& loc) { assert(std::has_facet<std::collate<char> >(loc)); @@ -54,8 +56,8 @@ int main() std::locale loc; assert(loc.name() == "C"); 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; check(loc2); - assert(loc2 == std::locale("en_US.UTF-8")); + assert(loc2 == std::locale(LOCALE_en_US_UTF_8)); } diff --git a/libcxx/test/platform_support.h b/libcxx/test/platform_support.h new file mode 100644 index 00000000000..11cdb0452bb --- /dev/null +++ b/libcxx/test/platform_support.h @@ -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 diff --git a/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp b/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp index 13572b5cca8..173ecdd99c1 100644 --- a/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp +++ b/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp @@ -17,13 +17,15 @@ #include <locale> #include <cassert> +#include "../../../platform_support.h" // locale name macros + int main() { 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(r.getloc().name() == "en_US.UTF-8"); + assert(r.getloc().name() == LOCALE_en_US_UTF_8); 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"); } diff --git a/libcxx/test/re/re.traits/default.pass.cpp b/libcxx/test/re/re.traits/default.pass.cpp index f486a717db1..babc1c5412e 100644 --- a/libcxx/test/re/re.traits/default.pass.cpp +++ b/libcxx/test/re/re.traits/default.pass.cpp @@ -17,6 +17,8 @@ #include <regex> #include <cassert> +#include "../../platform_support.h" // locale name macros + int main() { { @@ -26,10 +28,10 @@ int main() 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; - assert(t1.getloc().name() == "en_US.UTF-8"); + assert(t1.getloc().name() == LOCALE_en_US_UTF_8); std::regex_traits<wchar_t> t2; - assert(t2.getloc().name() == "en_US.UTF-8"); + assert(t2.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/libcxx/test/re/re.traits/getloc.pass.cpp b/libcxx/test/re/re.traits/getloc.pass.cpp index 0bda93d56ff..d2eb21c8007 100644 --- a/libcxx/test/re/re.traits/getloc.pass.cpp +++ b/libcxx/test/re/re.traits/getloc.pass.cpp @@ -16,6 +16,8 @@ #include <regex> #include <cassert> +#include "../../platform_support.h" // locale name macros + int main() { { @@ -25,10 +27,10 @@ int main() 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; - assert(t1.getloc().name() == "en_US.UTF-8"); + assert(t1.getloc().name() == LOCALE_en_US_UTF_8); std::regex_traits<wchar_t> t2; - assert(t2.getloc().name() == "en_US.UTF-8"); + assert(t2.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/libcxx/test/re/re.traits/imbue.pass.cpp b/libcxx/test/re/re.traits/imbue.pass.cpp index acdabda50bb..224efd71aaf 100644 --- a/libcxx/test/re/re.traits/imbue.pass.cpp +++ b/libcxx/test/re/re.traits/imbue.pass.cpp @@ -17,12 +17,14 @@ #include <locale> #include <cassert> +#include "../../platform_support.h" // locale name macros + int main() { { 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(t.getloc().name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/libcxx/test/re/re.traits/translate_nocase.pass.cpp b/libcxx/test/re/re.traits/translate_nocase.pass.cpp index 2d02b65c4c0..86d303ae19a 100644 --- a/libcxx/test/re/re.traits/translate_nocase.pass.cpp +++ b/libcxx/test/re/re.traits/translate_nocase.pass.cpp @@ -17,6 +17,8 @@ #include <regex> #include <cassert> +#include "../../platform_support.h" + int main() { { @@ -29,7 +31,7 @@ int main() assert(t.translate_nocase('1') == '1'); assert(t.translate_nocase('\xDA') == '\xDA'); 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('A') == 'a'); 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'\xDA') == L'\xDA'); 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'A') == L'a'); assert(t.translate_nocase(L'\x07') == L'\x07'); |