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/test/input.output | |
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/test/input.output')
17 files changed, 88 insertions, 54 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; |