[libcxx-commits] [PATCH] D105568: [libc++] Guard testing implementation details.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 7 11:25:48 PDT 2021


Mordante created this revision.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

The unit tests test some implementation details. As @Quuxplusone pointed
out in D96664 <https://reviews.llvm.org/D96664> this should only be tested when the tests use libc++. This
addresses the issue for code already in main.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105568

Files:
  libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
  libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp


Index: libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
===================================================================
--- libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
+++ libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
@@ -39,8 +39,12 @@
     context.next_arg_id();
     assert(false);
   } catch (const std::format_error& e) {
+#ifdef _LIBCPP_VERSION
     assert(strcmp(e.what(), "Using automatic argument numbering in manual "
                             "argument numbering mode") == 0);
+#else
+    (void)e;
+#endif
     return;
   }
   assert(false);
Index: libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
===================================================================
--- libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
+++ libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
@@ -39,8 +39,12 @@
       context.check_arg_id(0);
       assert(false);
     } catch (const std::format_error& e) {
+#ifdef _LIBCPP_VERSION
       assert(strcmp(e.what(), "Using manual argument numbering in automatic "
                               "argument numbering mode") == 0);
+#else
+      (void)e;
+#endif
       return;
     }
     assert(false);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105568.357014.patch
Type: text/x-patch
Size: 1393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210707/f3794ef0/attachment.bin>


More information about the libcxx-commits mailing list