From c0d0cbad9ed434267a7af9531bdeeae52eb6d706 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 3 Oct 2011 15:23:59 +0000 Subject: [PATCH] Windows porting work by Ruben Van Boxem git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@141003 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../filebuf.virtuals/overflow.pass.cpp | 4 +- .../filebuf.virtuals/underflow.pass.cpp | 4 +- .../ext.manip/get_money.pass.cpp | 10 +++-- .../ext.manip/get_time.pass.cpp | 6 ++- .../ext.manip/put_money.pass.cpp | 10 +++-- .../ext.manip/put_time.pass.cpp | 6 ++- .../register_callback.pass.cpp | 6 ++- .../ios.base/ios.base.locales/imbue.pass.cpp | 12 +++--- .../ios/basic.ios.members/copyfmt.pass.cpp | 18 +++++---- .../ios/basic.ios.members/imbue.pass.cpp | 18 +++++---- .../ios/basic.ios.members/move.pass.cpp | 6 ++- .../ios/basic.ios.members/swap.pass.cpp | 10 +++-- .../streambuf/streambuf.cons/copy.pass.cpp | 4 +- .../streambuf/streambuf.cons/default.pass.cpp | 8 ++-- .../streambuf.locales/locales.pass.cpp | 12 +++--- .../streambuf.assign/assign.pass.cpp | 4 +- .../streambuf.assign/swap.pass.cpp | 4 +- .../locale.collate.byname/compare.pass.cpp | 4 +- .../locale.collate.byname/hash.pass.cpp | 4 +- .../locale.collate.byname/transform.pass.cpp | 6 ++- .../locale.collate.byname/types.pass.cpp | 4 +- .../ctor_wchar_t.pass.cpp | 10 +++-- .../locale.ctype.byname/is_1.pass.cpp | 4 +- .../locale.ctype.byname/is_many.pass.cpp | 4 +- .../locale.ctype.byname/narrow_1.pass.cpp | 6 ++- .../locale.ctype.byname/narrow_many.pass.cpp | 6 ++- .../locale.ctype.byname/scan_is.pass.cpp | 4 +- .../locale.ctype.byname/scan_not.pass.cpp | 4 +- .../locale.ctype.byname/tolower_1.pass.cpp | 6 ++- .../locale.ctype.byname/tolower_many.pass.cpp | 6 ++- .../locale.ctype.byname/toupper_1.pass.cpp | 6 ++- .../locale.ctype.byname/toupper_many.pass.cpp | 6 ++- .../locale.ctype.byname/types.pass.cpp | 4 +- .../locale.ctype.byname/widen_1.pass.cpp | 4 +- .../locale.ctype.byname/widen_many.pass.cpp | 4 +- .../get_long_double_en_US.pass.cpp | 4 +- .../get_long_double_fr_FR.pass.cpp | 4 +- .../get_long_double_ru_RU.pass.cpp | 4 +- .../get_long_double_zh_CN.pass.cpp | 4 +- .../get_string_en_US.pass.cpp | 4 +- .../put_long_double_en_US.pass.cpp | 4 +- .../put_long_double_fr_FR.pass.cpp | 4 +- .../put_long_double_ru_RU.pass.cpp | 4 +- .../put_long_double_zh_CN.pass.cpp | 4 +- .../put_string_en_US.pass.cpp | 4 +- .../curr_symbol.pass.cpp | 34 +++++++++-------- .../decimal_point.pass.cpp | 34 +++++++++-------- .../frac_digits.pass.cpp | 34 +++++++++-------- .../grouping.pass.cpp | 34 +++++++++-------- .../neg_format.pass.cpp | 34 +++++++++-------- .../negative_sign.pass.cpp | 34 +++++++++-------- .../pos_format.pass.cpp | 34 +++++++++-------- .../positive_sign.pass.cpp | 34 +++++++++-------- .../thousands_sep.pass.cpp | 34 +++++++++-------- .../date_order.pass.cpp | 10 +++-- .../date_order_wide.pass.cpp | 10 +++-- .../locale.time.get.byname/get_date.pass.cpp | 10 +++-- .../get_date_wide.pass.cpp | 10 +++-- .../get_monthname.pass.cpp | 10 +++-- .../get_monthname_wide.pass.cpp | 10 +++-- .../locale.time.get.byname/get_one.pass.cpp | 18 +++++---- .../get_one_wide.pass.cpp | 16 ++++---- .../locale.time.get.byname/get_time.pass.cpp | 10 +++-- .../get_time_wide.pass.cpp | 10 +++-- .../get_weekday.pass.cpp | 10 +++-- .../get_weekday_wide.pass.cpp | 10 +++-- .../locale.time.get.byname/get_year.pass.cpp | 10 +++-- .../get_year_wide.pass.cpp | 10 +++-- .../locale.time.put.byname/put1.pass.cpp | 6 ++- .../decimal_point.pass.cpp | 6 ++- .../locale.numpunct.byname/grouping.pass.cpp | 6 ++- .../thousands_sep.pass.cpp | 6 ++- .../locale/locale.cons/assign.pass.cpp | 4 +- .../locale/locale.cons/char_pointer.pass.cpp | 8 ++-- .../locales/locale/locale.cons/copy.pass.cpp | 4 +- .../locale/locale.cons/default.pass.cpp | 6 ++- .../locale_char_pointer_cat.pass.cpp | 6 ++- .../locale.cons/locale_facetptr.pass.cpp | 4 +- .../locale.cons/locale_locale_cat.pass.cpp | 6 ++- .../locale.cons/locale_string_cat.pass.cpp | 6 ++- .../locale/locale.cons/string.pass.cpp | 8 ++-- .../locale/locale.members/name.pass.cpp | 6 ++- .../locale/locale.operators/eq.pass.cpp | 6 ++- .../locale/locale.statics/global.pass.cpp | 6 ++- test/platform_support.h | 37 +++++++++++++++++++ .../re.regex/re.regex.locale/imbue.pass.cpp | 8 ++-- test/re/re.traits/default.pass.cpp | 8 ++-- test/re/re.traits/getloc.pass.cpp | 8 ++-- test/re/re.traits/imbue.pass.cpp | 6 ++- test/re/re.traits/translate_nocase.pass.cpp | 6 ++- 90 files changed, 558 insertions(+), 343 deletions(-) create mode 100644 test/platform_support.h diff --git a/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp index 2bf60aa9d..24d130cd8 100644 --- a/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp +++ b/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp @@ -16,6 +16,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + template struct test_buf : public std::basic_filebuf @@ -115,7 +117,7 @@ int main() std::remove("overflow.dat"); { test_buf 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/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp index 670a254ec..af6c65181 100644 --- a/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp +++ b/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp @@ -16,6 +16,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + template struct test_buf : public std::basic_filebuf @@ -108,7 +110,7 @@ int main() } { test_buf 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/test/input.output/iostream.format/ext.manip/get_money.pass.cpp b/test/input.output/iostream.format/ext.manip/get_money.pass.cpp index 8230fe927..297319c15 100644 --- a/test/input.output/iostream.format/ext.manip/get_money.pass.cpp +++ b/test/input.output/iostream.format/ext.manip/get_money.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include "../../../platform_support.h" // locale name macros + template struct testbuf : public std::basic_streambuf @@ -39,7 +41,7 @@ int main() { testbuf 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 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 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 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/test/input.output/iostream.format/ext.manip/get_time.pass.cpp b/test/input.output/iostream.format/ext.manip/get_time.pass.cpp index 9804015a7..825b9959d 100644 --- a/test/input.output/iostream.format/ext.manip/get_time.pass.cpp +++ b/test/input.output/iostream.format/ext.manip/get_time.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include "../../../platform_support.h" // locale name macros + template struct testbuf : public std::basic_streambuf @@ -39,7 +41,7 @@ int main() { testbuf 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 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/test/input.output/iostream.format/ext.manip/put_money.pass.cpp b/test/input.output/iostream.format/ext.manip/put_money.pass.cpp index 0b0681895..e6d3d3891 100644 --- a/test/input.output/iostream.format/ext.manip/put_money.pass.cpp +++ b/test/input.output/iostream.format/ext.manip/put_money.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include "../../../platform_support.h" // locale name macros + template class testbuf : public std::basic_streambuf @@ -51,7 +53,7 @@ int main() { testbuf 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 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 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 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/test/input.output/iostream.format/ext.manip/put_time.pass.cpp b/test/input.output/iostream.format/ext.manip/put_time.pass.cpp index 9f5710d91..ca4d7e130 100644 --- a/test/input.output/iostream.format/ext.manip/put_time.pass.cpp +++ b/test/input.output/iostream.format/ext.manip/put_time.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include "../../../platform_support.h" // locale name macros + template class testbuf : public std::basic_streambuf @@ -51,7 +53,7 @@ int main() { testbuf 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 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/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp b/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp index bb6750249..db5781130 100644 --- a/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp +++ b/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp @@ -18,6 +18,8 @@ #include #include +#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/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp b/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp index eb508f044..66bf82977 100644 --- a/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp +++ b/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp @@ -18,6 +18,8 @@ #include #include +#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/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp b/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp index 74cac0530..95048deda 100644 --- a/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp +++ b/test/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp b/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp index ed022ca41..33c32a79d 100644 --- a/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp +++ b/test/input.output/iostreams.base/ios/basic.ios.members/imbue.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp b/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp index 213b0f845..647606da8 100644 --- a/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp +++ b/test/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp b/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp index 5de9229e4..5a59b350c 100644 --- a/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp +++ b/test/input.output/iostreams.base/ios/basic.ios.members/swap.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp b/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp index ffad159f8..8af132e5b 100644 --- a/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp +++ b/test/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + template struct test : public std::basic_streambuf @@ -70,7 +72,7 @@ int main() t.setp(&p1, &p3); test t2 = t; } - std::locale::global(std::locale("en_US.UTF-8")); + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2 = t; diff --git a/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp b/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp index f8f3b8010..3869c0bcf 100644 --- a/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp +++ b/test/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + template struct test : public std::basic_streambuf @@ -42,13 +44,13 @@ int main() test 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 t; - assert(t.getloc().name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } { test t; - assert(t.getloc().name() == "en_US.UTF-8"); + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp b/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp index 637fcbe8e..2b8181f50 100644 --- a/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp +++ b/test/input.output/stream.buffers/streambuf/streambuf.members/streambuf.locales/locales.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "../../../../../platform_support.h" // locale name macros + template struct test : public std::basic_streambuf @@ -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 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 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/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp b/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp index def79eef4..bde167677 100644 --- a/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp +++ b/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../../platform_support.h" // locale name macros + template struct test : public std::basic_streambuf @@ -75,7 +77,7 @@ int main() test t2; t2 = t; } - std::locale::global(std::locale("en_US.UTF-8")); + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2; diff --git a/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp index 0b33d3367..9a07e9496 100644 --- a/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp +++ b/test/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../../platform_support.h" // locale name macros + template struct test : public std::basic_streambuf @@ -85,7 +87,7 @@ int main() test t2; swap(t2, t); } - std::locale::global(std::locale("en_US.UTF-8")); + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2; diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp index 0e5d581ec..f564adaea 100644 --- a/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp +++ b/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp @@ -24,10 +24,12 @@ #include +#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& f = std::use_facet >(l); std::string s2("aaaaaaA"); diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp index 0ba8d03b0..9ebf2f984 100644 --- a/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp +++ b/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp @@ -19,9 +19,11 @@ #include #include +#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/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp index cd94c0fca..70898d17d 100644 --- a/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp +++ b/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp @@ -19,12 +19,14 @@ #include +#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("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& f = std::use_facet >(l); diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp index 50e803313..021d92d4a 100644 --- a/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp +++ b/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp @@ -27,9 +27,11 @@ #include +#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 >(l)); assert(&std::use_facet >(l) diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp index f76232f71..736be10cf 100644 --- a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + typedef std::codecvt_byname 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/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp index e6da32038..ec6b95bfb 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp @@ -17,10 +17,12 @@ #include #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp index 4f3b0abf4..e573574ca 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp @@ -20,10 +20,12 @@ #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp index 4885290ef..c1edbfaf0 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp @@ -16,10 +16,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp index 77688198e..1a758013d 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp @@ -18,10 +18,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp index a758f5146..d3da67e29 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp @@ -20,10 +20,12 @@ #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp index b53a16a55..603c33ad5 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp @@ -20,10 +20,12 @@ #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp index 3e8908bbe..e5c76c8b8 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp @@ -16,10 +16,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp index 3fbd46fcd..11eba5293 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp @@ -17,10 +17,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp index 495b2020d..e31a808eb 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp @@ -16,10 +16,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp index b5a899921..6a6c9ef5d 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp @@ -17,10 +17,12 @@ #include #include +#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 F; const F& f = std::use_facet(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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp index bb6c73c99..aaa5fe962 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp @@ -25,10 +25,12 @@ #include #include +#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 >(l)); assert(&std::use_facet >(l) diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp index b45971fe6..022a59500 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp @@ -19,10 +19,12 @@ #include #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp index 59bf3e366..bf2295961 100644 --- a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp +++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp @@ -20,10 +20,12 @@ #include #include +#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 F; const F& f = std::use_facet(l); diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp index d4dfbd1e3..2340336c3 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp index 7596099fe..6da2527e5 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp index 5cfc8bdb2..041156d37 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp index 15042d972..3a0097343 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp index c9984c84a..3ec5c57a5 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp @@ -20,6 +20,8 @@ #include #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_get > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp index 6f359ab2f..e6672880d 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp index 32eb081b4..c724c2395 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp index 879ae4e2e..0e593e616 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp index 3f08d2f74..5cf4b526d 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp +++ b/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 #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp index cbbeeab5d..30f0b2d62 100644 --- a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp @@ -20,6 +20,8 @@ #include #include "iterators.h" +#include "../../../../../platform_support.h" // locale name macros + typedef std::money_put > 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(loc_name))); ios.imbue(std::locale(ios.getloc(), diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp index f6554a22c..e53711aae 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp index 47ba877d0..9e6a629b8 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp index f30f004a7..7893d21d1 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp index 14edf6923..7802fafc1 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp index 027044ddf..fc2165a67 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp index 4b78c77f9..a84c3c62d 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp index 325a5a1b8..21e7d0335 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp index d9107f4ce..59990dd11 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp index bc9e0a920..92b036902 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + class Fnf : public std::moneypunct_byname { @@ -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/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp index d250c2578..b6d7d09db 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp @@ -17,6 +17,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_get_byname > 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/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp index 8f3dc704c..9f8e8ad06 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp @@ -17,6 +17,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_get_byname > 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp index 8dbe53123..84ff3c9fa 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp index 9969f5975..68c148fec 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp index 6e2448406..5d7bafb2b 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp index 5fdd23b18..6909123c0 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp index cba5a6b7c..07d36c83a 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp @@ -18,6 +18,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp index 7e4f24276..2d5b9412d 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp @@ -18,6 +18,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp index 019abde88..425fa399a 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp index 6cf658f1c..6cf2abb53 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp index c993e6556..fb50ae83d 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp index fe804e7dc..169b19208 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp @@ -19,6 +19,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp index fd0f18bd0..546110432 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp @@ -18,6 +18,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp index f598037d5..0361bb030 100644 --- a/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp @@ -18,6 +18,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef input_iterator I; typedef std::time_get_byname 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/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp index 3df454eef..003346167 100644 --- a/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp +++ b/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp @@ -25,6 +25,8 @@ #include #include "iterators.h" +#include "../../../../platform_support.h" // locale name macros + typedef std::time_put_byname > 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(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(str), ios, '*', &t, pat.data(), pat.data() + pat.size()); diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp index 3acd317e1..fbfd189cc 100644 --- a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp +++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp @@ -16,6 +16,8 @@ #include #include +#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& np = std::use_facet >(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& np = std::use_facet >(l); diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp index 5e9e46769..ec0ed36a5 100644 --- a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp +++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp @@ -16,6 +16,8 @@ #include #include +#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& np = std::use_facet >(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& np = std::use_facet >(l); diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp index b94cee4a0..10eebffed 100644 --- a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp +++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp @@ -16,6 +16,8 @@ #include #include +#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& np = std::use_facet >(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& np = std::use_facet >(l); diff --git a/test/localization/locales/locale/locale.cons/assign.pass.cpp b/test/localization/locales/locale/locale.cons/assign.pass.cpp index 27f851c93..b6fcf3e73 100644 --- a/test/localization/locales/locale/locale.cons/assign.pass.cpp +++ b/test/localization/locales/locale/locale.cons/assign.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp index 30268a413..737da285d 100644 --- a/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp +++ b/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/copy.pass.cpp b/test/localization/locales/locale/locale.cons/copy.pass.cpp index fa8631caa..03845757d 100644 --- a/test/localization/locales/locale/locale.cons/copy.pass.cpp +++ b/test/localization/locales/locale/locale.cons/copy.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/default.pass.cpp b/test/localization/locales/locale/locale.cons/default.pass.cpp index 3ea1ff1fb..9a7809fc7 100644 --- a/test/localization/locales/locale/locale.cons/default.pass.cpp +++ b/test/localization/locales/locale/locale.cons/default.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp index 7aa054903..0e6c071c6 100644 --- a/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp +++ b/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp index 868df624f..e8016f48b 100644 --- a/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp +++ b/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp index 4dc7744f0..586febb02 100644 --- a/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp +++ b/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp index 6650d5448..3b43e70e5 100644 --- a/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp +++ b/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.cons/string.pass.cpp b/test/localization/locales/locale/locale.cons/string.pass.cpp index f831f9f87..8cfeccf78 100644 --- a/test/localization/locales/locale/locale.cons/string.pass.cpp +++ b/test/localization/locales/locale/locale.cons/string.pass.cpp @@ -15,6 +15,8 @@ #include #include +#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/test/localization/locales/locale/locale.members/name.pass.cpp b/test/localization/locales/locale/locale.members/name.pass.cpp index 3092d8acc..9948854fa 100644 --- a/test/localization/locales/locale/locale.members/name.pass.cpp +++ b/test/localization/locales/locale/locale.members/name.pass.cpp @@ -14,6 +14,8 @@ #include #include +#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/test/localization/locales/locale/locale.operators/eq.pass.cpp b/test/localization/locales/locale/locale.operators/eq.pass.cpp index 0a671cc26..b3cf68e3b 100644 --- a/test/localization/locales/locale/locale.operators/eq.pass.cpp +++ b/test/localization/locales/locale/locale.operators/eq.pass.cpp @@ -14,12 +14,14 @@ #include #include +#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 >(cloc); std::locale nonamec = noname1; std::locale noname2 = n1.combine >(cloc); diff --git a/test/localization/locales/locale/locale.statics/global.pass.cpp b/test/localization/locales/locale/locale.statics/global.pass.cpp index 74a4a843f..ca73505d3 100644 --- a/test/localization/locales/locale/locale.statics/global.pass.cpp +++ b/test/localization/locales/locale/locale.statics/global.pass.cpp @@ -14,6 +14,8 @@ #include #include +#include "../../../../platform_support.h" // locale name macros + void check(const std::locale& loc) { assert(std::has_facet >(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/test/platform_support.h b/test/platform_support.h new file mode 100644 index 000000000..11cdb0452 --- /dev/null +++ b/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/test/re/re.regex/re.regex.locale/imbue.pass.cpp b/test/re/re.regex/re.regex.locale/imbue.pass.cpp index 13572b5cc..173ecdd99 100644 --- a/test/re/re.regex/re.regex.locale/imbue.pass.cpp +++ b/test/re/re.regex/re.regex.locale/imbue.pass.cpp @@ -17,13 +17,15 @@ #include #include +#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/test/re/re.traits/default.pass.cpp b/test/re/re.traits/default.pass.cpp index f486a717d..babc1c541 100644 --- a/test/re/re.traits/default.pass.cpp +++ b/test/re/re.traits/default.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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 t1; - assert(t1.getloc().name() == "en_US.UTF-8"); + assert(t1.getloc().name() == LOCALE_en_US_UTF_8); std::regex_traits t2; - assert(t2.getloc().name() == "en_US.UTF-8"); + assert(t2.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/test/re/re.traits/getloc.pass.cpp b/test/re/re.traits/getloc.pass.cpp index 0bda93d56..d2eb21c80 100644 --- a/test/re/re.traits/getloc.pass.cpp +++ b/test/re/re.traits/getloc.pass.cpp @@ -16,6 +16,8 @@ #include #include +#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 t1; - assert(t1.getloc().name() == "en_US.UTF-8"); + assert(t1.getloc().name() == LOCALE_en_US_UTF_8); std::regex_traits t2; - assert(t2.getloc().name() == "en_US.UTF-8"); + assert(t2.getloc().name() == LOCALE_en_US_UTF_8); } } diff --git a/test/re/re.traits/imbue.pass.cpp b/test/re/re.traits/imbue.pass.cpp index acdabda50..224efd71a 100644 --- a/test/re/re.traits/imbue.pass.cpp +++ b/test/re/re.traits/imbue.pass.cpp @@ -17,12 +17,14 @@ #include #include +#include "../../platform_support.h" // locale name macros + int main() { { std::regex_traits 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/test/re/re.traits/translate_nocase.pass.cpp b/test/re/re.traits/translate_nocase.pass.cpp index 2d02b65c4..86d303ae1 100644 --- a/test/re/re.traits/translate_nocase.pass.cpp +++ b/test/re/re.traits/translate_nocase.pass.cpp @@ -17,6 +17,8 @@ #include #include +#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');