[libcxx-commits] [PATCH] D118238: [libcxx] [test] Simplify the handling of platform specific NAN formatting in put_long_double

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 10 10:40:44 PST 2022


mstorsjo added inline comments.


================
Comment at: libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp:10911
                                     std::string ex(str, iter.base());
-#if defined(TEST_HAS_GLIBC)
-                                    assert(ex == "*********************+nan");
-#else
-                                    assert(ex == "**********************nan");
-#endif
+                                    assert(ex == pnan_padding25 + pnan);
                                     assert(ios.width() == 0);
----------------
Mordante wrote:
> How do you feel about always using strings like `pnan_padding25 + pnan_sign + "nan"` and not have `pnan` and `PNAN`?
That’d work for me too.


================
Comment at: libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp:24417
     std::locale lg(lc, new my_numpunct);
-#if defined(__APPLE__) && defined(__x86_64__)
+#if (defined(__APPLE__) || defined(TEST_HAS_GLIBC)) && defined(__x86_64__)
 // This test is failing on FreeBSD, possibly due to different representations
----------------
Mordante wrote:
> Is this change still needed? The test currently passes CI without this change.
It’s not needed, but this is a test that currently only is executed on apple platforms (because it hadn’t passed on FreeBSD). This test does pass on glibc too, so let’s run it there too, for increased test coverage.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118238/new/

https://reviews.llvm.org/D118238



More information about the libcxx-commits mailing list