diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp @@ -12,9 +12,6 @@ // iter_type put(iter_type s, ios_base& iob, char_type fill, long double v) const; -// TODO GLIBC uses a different string for positive and negative NAN numbers. -// XFAIL: target={{.*}}-linux-gnu{{.*}} - // XFAIL: LIBCXX-WINDOWS-FIXME // XFAIL: LIBCXX-AIX-FIXME @@ -10884,7 +10881,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan"); +#else assert(ex == "nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10892,7 +10893,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan*********************"); +#else assert(ex == "nan**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10900,7 +10905,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10908,7 +10917,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } } @@ -10918,7 +10931,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan"); +#else assert(ex == "nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10926,7 +10943,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan*********************"); +#else assert(ex == "nan**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10934,7 +10955,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10942,7 +10967,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } } @@ -10955,7 +10984,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan"); +#else assert(ex == "nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10963,7 +10996,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan*********************"); +#else assert(ex == "nan**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10971,7 +11008,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10979,7 +11020,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } } @@ -10989,7 +11034,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan"); +#else assert(ex == "nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -10997,7 +11046,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+nan*********************"); +#else assert(ex == "nan**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11005,7 +11058,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11013,7 +11070,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************nan"); +#else assert(ex == "**********************nan"); +#endif assert(ios.width() == 0); } } @@ -11177,7 +11238,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN"); +#else assert(ex == "NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11185,7 +11250,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN*********************"); +#else assert(ex == "NAN**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11193,7 +11262,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11201,7 +11274,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } } @@ -11211,7 +11288,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN"); +#else assert(ex == "NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11219,7 +11300,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN*********************"); +#else assert(ex == "NAN**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11227,7 +11312,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11235,7 +11324,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } } @@ -11248,7 +11341,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN"); +#else assert(ex == "NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11256,7 +11353,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN*********************"); +#else assert(ex == "NAN**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11264,7 +11365,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11272,7 +11377,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } } @@ -11282,7 +11391,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN"); +#else assert(ex == "NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11290,7 +11403,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+NAN*********************"); +#else assert(ex == "NAN**********************"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11298,7 +11415,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "*********************+NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } ios.width(25); @@ -11306,7 +11427,11 @@ { cpp17_output_iterator iter = f.put(cpp17_output_iterator(str), ios, '*', v); std::string ex(str, iter.base()); +#if defined(TEST_HAS_GLIBC) + assert(ex == "+*********************NAN"); +#else assert(ex == "**********************NAN"); +#endif assert(ios.width() == 0); } }