diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp @@ -14,7 +14,6 @@ // ios_base::iostate& err, long double& v) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME #include #include @@ -47,6 +46,22 @@ }; #endif +std::string negate(std::string s) { +#if defined(_WIN32) + return "(" + s + ")"; +#else + return "-" + s; +#endif +} + +std::wstring negate(std::wstring s) { +#if defined(_WIN32) + return L"(" + s + L")"; +#else + return L"-" + s; +#endif +} + int main(int, char**) { std::ios ios(0); @@ -76,7 +91,7 @@ assert(ex == 0); } { // negative one - std::string v = "-0.01"; + std::string v = negate("0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -98,7 +113,7 @@ assert(ex == 123456789); } { // negative - std::string v = "-1,234,567.89"; + std::string v = negate("1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -109,7 +124,7 @@ assert(ex == -123456789); } { // negative - std::string v = "-1234567.89"; + std::string v = negate("1234567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -144,7 +159,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::string v = "-$0.01"; + std::string v = negate("$0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -155,7 +170,7 @@ assert(ex == -1); } { // negative one, showbase - std::string v = "-$0.01"; + std::string v = negate("$0.01"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -192,7 +207,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -205,7 +220,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -217,7 +232,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -242,7 +257,7 @@ assert(ex == 0); } { // negative one - std::string v = "-0.01"; + std::string v = negate("0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -264,7 +279,7 @@ assert(ex == 123456789); } { // negative - std::string v = "-1,234,567.89"; + std::string v = negate("1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -275,7 +290,7 @@ assert(ex == -123456789); } { // negative - std::string v = "-1234567.89"; + std::string v = negate("1234567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -310,7 +325,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::string v = "-USD 0.01"; + std::string v = negate("USD 0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -321,7 +336,7 @@ assert(ex == -1); } { // negative one, showbase - std::string v = "-USD 0.01"; + std::string v = negate("USD 0.01"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -358,7 +373,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -371,7 +386,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -383,7 +398,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -409,7 +424,7 @@ assert(ex == 0); } { // negative one - std::wstring v = L"-0.01"; + std::wstring v = negate(L"0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -431,7 +446,7 @@ assert(ex == 123456789); } { // negative - std::wstring v = L"-1,234,567.89"; + std::wstring v = negate(L"1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -442,7 +457,7 @@ assert(ex == -123456789); } { // negative - std::wstring v = L"-1234567.89"; + std::wstring v = negate(L"1234567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -477,7 +492,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::wstring v = L"-$0.01"; + std::wstring v = negate(L"$0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -488,7 +503,7 @@ assert(ex == -1); } { // negative one, showbase - std::wstring v = L"-$0.01"; + std::wstring v = negate(L"$0.01"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -525,7 +540,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -538,7 +553,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -550,7 +565,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -575,7 +590,7 @@ assert(ex == 0); } { // negative one - std::wstring v = L"-0.01"; + std::wstring v = negate(L"0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -597,7 +612,7 @@ assert(ex == 123456789); } { // negative - std::wstring v = L"-1,234,567.89"; + std::wstring v = negate(L"1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -608,7 +623,7 @@ assert(ex == -123456789); } { // negative - std::wstring v = L"-1234567.89"; + std::wstring v = negate(L"1234567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -643,7 +658,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::wstring v = L"-USD 0.01"; + std::wstring v = negate(L"USD 0.01"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -654,7 +669,7 @@ assert(ex == -1); } { // negative one, showbase - std::wstring v = L"-USD 0.01"; + std::wstring v = negate(L"USD 0.01"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -691,7 +706,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -704,7 +719,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; long double ex; @@ -716,7 +731,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); typedef cpp17_input_iterator I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp @@ -14,7 +14,6 @@ // ios_base::iostate& err, string_type& v) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME #include #include @@ -47,6 +46,22 @@ }; #endif +std::string negate(std::string s) { +#if defined(_WIN32) + return "(" + s + ")"; +#else + return "-" + s; +#endif +} + +std::wstring negate(std::wstring s) { +#if defined(_WIN32) + return L"(" + s + L")"; +#else + return L"-" + s; +#endif +} + int main(int, char**) { std::ios ios(0); @@ -76,7 +91,7 @@ assert(ex == "0"); } { // negative one - std::string v = "-0.01"; + std::string v = negate("0.01"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -98,7 +113,7 @@ assert(ex == "123456789"); } { // negative - std::string v = "-1,234,567.89"; + std::string v = negate("1,234,567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -109,7 +124,7 @@ assert(ex == "-123456789"); } { // negative - std::string v = "-1234567.89"; + std::string v = negate("1234567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -144,7 +159,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::string v = "-$0.01"; + std::string v = negate("$0.01"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -155,7 +170,7 @@ assert(ex == "-1"); } { // negative one, showbase - std::string v = "-$0.01"; + std::string v = negate("$0.01"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -192,7 +207,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -205,7 +220,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -218,7 +233,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -244,7 +259,7 @@ assert(ex == "0"); } { // negative one - std::string v = "-0.01"; + std::string v = negate("0.01"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -266,7 +281,7 @@ assert(ex == "123456789"); } { // negative - std::string v = "-1,234,567.89"; + std::string v = negate("1,234,567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -277,7 +292,7 @@ assert(ex == "-123456789"); } { // negative - std::string v = "-1234567.89"; + std::string v = negate("1234567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -312,7 +327,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::string v = "-USD 0.01"; + std::string v = negate("USD 0.01"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -323,7 +338,7 @@ assert(ex == "-1"); } { // negative one, showbase - std::string v = "-USD 0.01"; + std::string v = negate("USD 0.01"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -360,7 +375,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-USD 1,234,567.89"; + std::string v = negate("USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -373,7 +388,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::string ex; @@ -386,7 +401,7 @@ std::noshowbase(ios); } { // negative, showbase - std::string v = "-$1,234,567.89"; + std::string v = negate("$1,234,567.89"); typedef cpp17_input_iterator I; std::string ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -413,7 +428,7 @@ assert(ex == L"0"); } { // negative one - std::wstring v = L"-0.01"; + std::wstring v = negate(L"0.01"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -435,7 +450,7 @@ assert(ex == L"123456789"); } { // negative - std::wstring v = L"-1,234,567.89"; + std::wstring v = negate(L"1,234,567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -446,7 +461,7 @@ assert(ex == L"-123456789"); } { // negative - std::wstring v = L"-1234567.89"; + std::wstring v = negate(L"1234567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -481,7 +496,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::wstring v = L"-$0.01"; + std::wstring v = negate(L"$0.01"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -492,7 +507,7 @@ assert(ex == L"-1"); } { // negative one, showbase - std::wstring v = L"-$0.01"; + std::wstring v = negate(L"$0.01"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -529,7 +544,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -542,7 +557,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -555,7 +570,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -581,7 +596,7 @@ assert(ex == L"0"); } { // negative one - std::wstring v = L"-0.01"; + std::wstring v = negate(L"0.01"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -603,7 +618,7 @@ assert(ex == L"123456789"); } { // negative - std::wstring v = L"-1,234,567.89"; + std::wstring v = negate(L"1,234,567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -614,7 +629,7 @@ assert(ex == L"-123456789"); } { // negative - std::wstring v = L"-1234567.89"; + std::wstring v = negate(L"1234567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -649,7 +664,7 @@ std::noshowbase(ios); } { // negative one, showbase - std::wstring v = L"-USD 0.01"; + std::wstring v = negate(L"USD 0.01"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -660,7 +675,7 @@ assert(ex == L"-1"); } { // negative one, showbase - std::wstring v = L"-USD 0.01"; + std::wstring v = negate(L"USD 0.01"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -697,7 +712,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-USD 1,234,567.89"; + std::wstring v = negate(L"USD 1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -710,7 +725,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); std::showbase(ios); typedef cpp17_input_iterator I; std::wstring ex; @@ -723,7 +738,7 @@ std::noshowbase(ios); } { // negative, showbase - std::wstring v = L"-$1,234,567.89"; + std::wstring v = negate(L"$1,234,567.89"); typedef cpp17_input_iterator I; std::wstring ex; std::ios_base::iostate err = std::ios_base::goodbit;