diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp @@ -12,8 +12,6 @@ // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - #include #include #include @@ -44,7 +42,11 @@ int main(int, char**) { { +#if defined(_WIN32) + testbuf sb(" ($1,234,567.89)"); +#else testbuf sb(" -$1,234,567.89"); +#endif std::istream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); long double x = 0; @@ -52,7 +54,11 @@ assert(x == -123456789); } { +#if defined(_WIN32) + testbuf sb(" (USD 1,234,567.89)"); +#else testbuf sb(" -USD 1,234,567.89"); +#endif std::istream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); long double x = 0; @@ -61,7 +67,11 @@ } #ifndef TEST_HAS_NO_WIDE_CHARACTERS { +#if defined(_WIN32) + testbuf sb(L" ($1,234,567.89)"); +#else testbuf sb(L" -$1,234,567.89"); +#endif std::wistream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); long double x = 0; @@ -69,7 +79,11 @@ assert(x == -123456789); } { +#if defined(_WIN32) + testbuf sb(L" (USD 1,234,567.89)"); +#else testbuf sb(L" -USD 1,234,567.89"); +#endif std::wistream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); long double x = 0; diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp @@ -12,8 +12,6 @@ // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - #include #include #include @@ -62,7 +60,11 @@ std::showbase(os); long double x = -123456789; os << std::put_money(x, false); +#if defined(_WIN32) + assert(sb.str() == "($1,234,567.89)"); +#else assert(sb.str() == "-$1,234,567.89"); +#endif } { testbuf sb; @@ -71,7 +73,11 @@ std::showbase(os); long double x = -123456789; os << std::put_money(x, true); +#if defined(_WIN32) + assert(sb.str() == "(USD1,234,567.89)"); +#else assert(sb.str() == "-USD 1,234,567.89"); +#endif } #ifndef TEST_HAS_NO_WIDE_CHARACTERS { @@ -81,7 +87,11 @@ std::showbase(os); long double x = -123456789; os << std::put_money(x, false); +#if defined(_WIN32) + assert(sb.str() == L"($1,234,567.89)"); +#else assert(sb.str() == L"-$1,234,567.89"); +#endif } { testbuf sb; @@ -90,7 +100,11 @@ std::showbase(os); long double x = -123456789; os << std::put_money(x, true); +#if defined(_WIN32) + assert(sb.str() == L"(USD1,234,567.89)"); +#else assert(sb.str() == L"-USD 1,234,567.89"); +#endif } #endif diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp @@ -14,7 +14,6 @@ // long double units) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME #include #include @@ -76,7 +75,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(0.01)"); +#else assert(ex == "-0.01"); +#endif } { // positive long double v = 123456789; @@ -90,7 +93,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(1,234,567.89)"); +#else assert(ex == "-1,234,567.89"); +#endif } { // zero, showbase long double v = 0; @@ -106,7 +113,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "($0.01)"); +#else assert(ex == "-$0.01"); +#endif } { // positive, showbase long double v = 123456789; @@ -122,7 +133,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "($1,234,567.89)"); +#else assert(ex == "-$1,234,567.89"); +#endif } { // negative, showbase, left long double v = -123456789; @@ -132,7 +147,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "($1,234,567.89) "); +#else assert(ex == "-$1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -143,7 +162,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "($ 1,234,567.89)"); +#else assert(ex == "-$ 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -154,7 +177,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == " ($1,234,567.89)"); +#else assert(ex == " -$1,234,567.89"); +#endif assert(ios.width() == 0); } @@ -173,7 +200,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(0.01)"); +#else assert(ex == "-0.01"); +#endif } { // positive long double v = 123456789; @@ -187,7 +218,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(1,234,567.89)"); +#else assert(ex == "-1,234,567.89"); +#endif } { // zero, showbase long double v = 0; @@ -195,7 +230,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "USD0.00"); +#else assert(ex == "USD 0.00"); +#endif } { // negative one, showbase long double v = -1; @@ -203,7 +242,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(USD0.01)"); +#else assert(ex == "-USD 0.01"); +#endif } { // positive, showbase long double v = 123456789; @@ -211,7 +254,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "USD1,234,567.89"); +#else assert(ex == "USD 1,234,567.89"); +#endif } { // negative, showbase long double v = -123456789; @@ -219,7 +266,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(USD1,234,567.89)"); +#else assert(ex == "-USD 1,234,567.89"); +#endif } { // negative, showbase, left long double v = -123456789; @@ -229,7 +280,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(USD1,234,567.89) "); +#else assert(ex == "-USD 1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -240,7 +295,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == "(USD 1,234,567.89)"); +#else assert(ex == "-USD 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -251,7 +310,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == " (USD1,234,567.89)"); +#else assert(ex == " -USD 1,234,567.89"); +#endif assert(ios.width() == 0); } } @@ -273,7 +336,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(0.01)"); +#else assert(ex == L"-0.01"); +#endif } { // positive long double v = 123456789; @@ -287,7 +354,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(1,234,567.89)"); +#else assert(ex == L"-1,234,567.89"); +#endif } { // zero, showbase long double v = 0; @@ -303,7 +374,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"($0.01)"); +#else assert(ex == L"-$0.01"); +#endif } { // positive, showbase long double v = 123456789; @@ -319,7 +394,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"($1,234,567.89)"); +#else assert(ex == L"-$1,234,567.89"); +#endif } { // negative, showbase, left long double v = -123456789; @@ -329,7 +408,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"($1,234,567.89) "); +#else assert(ex == L"-$1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -340,7 +423,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"($ 1,234,567.89)"); +#else assert(ex == L"-$ 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -351,7 +438,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L" ($1,234,567.89)"); +#else assert(ex == L" -$1,234,567.89"); +#endif assert(ios.width() == 0); } @@ -370,7 +461,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(0.01)"); +#else assert(ex == L"-0.01"); +#endif } { // positive long double v = 123456789; @@ -384,7 +479,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(1,234,567.89)"); +#else assert(ex == L"-1,234,567.89"); +#endif } { // zero, showbase long double v = 0; @@ -392,7 +491,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"USD0.00"); +#else assert(ex == L"USD 0.00"); +#endif } { // negative one, showbase long double v = -1; @@ -400,7 +503,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(USD0.01)"); +#else assert(ex == L"-USD 0.01"); +#endif } { // positive, showbase long double v = 123456789; @@ -408,7 +515,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"USD1,234,567.89"); +#else assert(ex == L"USD 1,234,567.89"); +#endif } { // negative, showbase long double v = -123456789; @@ -416,7 +527,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(USD1,234,567.89)"); +#else assert(ex == L"-USD 1,234,567.89"); +#endif } { // negative, showbase, left long double v = -123456789; @@ -426,7 +541,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(USD1,234,567.89) "); +#else assert(ex == L"-USD 1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -437,7 +556,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L"(USD 1,234,567.89)"); +#else assert(ex == L"-USD 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -448,7 +571,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#if defined(_WIN32) + assert(ex == L" (USD1,234,567.89)"); +#else assert(ex == L" -USD 1,234,567.89"); +#endif assert(ios.width() == 0); } } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp @@ -15,8 +15,6 @@ // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - #include #include #include @@ -77,7 +75,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(0.01)"); +#else assert(ex == "-0.01"); +#endif } { // positive std::string v = "123456789"; @@ -91,7 +93,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(1,234,567.89)"); +#else assert(ex == "-1,234,567.89"); +#endif } { // zero, showbase std::string v = "0"; @@ -107,7 +113,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "($0.01)"); +#else assert(ex == "-$0.01"); +#endif } { // positive, showbase std::string v = "123456789"; @@ -123,7 +133,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "($1,234,567.89)"); +#else assert(ex == "-$1,234,567.89"); +#endif } { // negative, showbase, left std::string v = "-123456789"; @@ -133,7 +147,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "($1,234,567.89) "); +#else assert(ex == "-$1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -144,7 +162,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "($ 1,234,567.89)"); +#else assert(ex == "-$ 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -155,7 +177,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == " ($1,234,567.89)"); +#else assert(ex == " -$1,234,567.89"); +#endif assert(ios.width() == 0); } @@ -174,7 +200,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(0.01)"); +#else assert(ex == "-0.01"); +#endif } { // positive std::string v = "123456789"; @@ -188,7 +218,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(1,234,567.89)"); +#else assert(ex == "-1,234,567.89"); +#endif } { // zero, showbase std::string v = "0"; @@ -196,7 +230,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "USD0.00"); +#else assert(ex == "USD 0.00"); +#endif } { // negative one, showbase std::string v = "-1"; @@ -204,7 +242,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(USD0.01)"); +#else assert(ex == "-USD 0.01"); +#endif } { // positive, showbase std::string v = "123456789"; @@ -212,7 +254,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "USD1,234,567.89"); +#else assert(ex == "USD 1,234,567.89"); +#endif } { // negative, showbase std::string v = "-123456789"; @@ -220,7 +266,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(USD1,234,567.89)"); +#else assert(ex == "-USD 1,234,567.89"); +#endif } { // negative, showbase, left std::string v = "-123456789"; @@ -230,7 +280,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(USD1,234,567.89) "); +#else assert(ex == "-USD 1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -241,7 +295,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == "(USD 1,234,567.89)"); +#else assert(ex == "-USD 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -252,7 +310,11 @@ char str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::string ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == " (USD1,234,567.89)"); +#else assert(ex == " -USD 1,234,567.89"); +#endif assert(ios.width() == 0); } } @@ -274,7 +336,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(0.01)"); +#else assert(ex == L"-0.01"); +#endif } { // positive std::wstring v = L"123456789"; @@ -288,7 +354,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(1,234,567.89)"); +#else assert(ex == L"-1,234,567.89"); +#endif } { // zero, showbase std::wstring v = L"0"; @@ -304,7 +374,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"($0.01)"); +#else assert(ex == L"-$0.01"); +#endif } { // positive, showbase std::wstring v = L"123456789"; @@ -320,7 +394,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"($1,234,567.89)"); +#else assert(ex == L"-$1,234,567.89"); +#endif } { // negative, showbase, left std::wstring v = L"-123456789"; @@ -330,7 +408,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"($1,234,567.89) "); +#else assert(ex == L"-$1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -341,7 +423,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"($ 1,234,567.89)"); +#else assert(ex == L"-$ 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -352,7 +438,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L" ($1,234,567.89)"); +#else assert(ex == L" -$1,234,567.89"); +#endif assert(ios.width() == 0); } @@ -371,7 +461,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(0.01)"); +#else assert(ex == L"-0.01"); +#endif } { // positive std::wstring v = L"123456789"; @@ -385,7 +479,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(1,234,567.89)"); +#else assert(ex == L"-1,234,567.89"); +#endif } { // zero, showbase std::wstring v = L"0"; @@ -393,7 +491,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"USD0.00"); +#else assert(ex == L"USD 0.00"); +#endif } { // negative one, showbase std::wstring v = L"-1"; @@ -401,7 +503,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(USD0.01)"); +#else assert(ex == L"-USD 0.01"); +#endif } { // positive, showbase std::wstring v = L"123456789"; @@ -409,7 +515,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"USD1,234,567.89"); +#else assert(ex == L"USD 1,234,567.89"); +#endif } { // negative, showbase std::wstring v = L"-123456789"; @@ -417,7 +527,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, '*', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(USD1,234,567.89)"); +#else assert(ex == L"-USD 1,234,567.89"); +#endif } { // negative, showbase, left std::wstring v = L"-123456789"; @@ -427,7 +541,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(USD1,234,567.89) "); +#else assert(ex == L"-USD 1,234,567.89 "); +#endif assert(ios.width() == 0); } { // negative, showbase, internal @@ -438,7 +556,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L"(USD 1,234,567.89)"); +#else assert(ex == L"-USD 1,234,567.89"); +#endif assert(ios.width() == 0); } { // negative, showbase, right @@ -449,7 +571,11 @@ wchar_t str[100]; cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); +#ifdef _WIN32 + assert(ex == L" (USD1,234,567.89)"); +#else assert(ex == L" -USD 1,234,567.89"); +#endif assert(ios.width() == 0); } }