[PATCH] D26625: [libcxx] [test] future_error::what() is implementation-defined.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 12:08:07 PST 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] future_error::what() is implementation-defined.


https://reviews.llvm.org/D26625

Files:
  test/std/thread/futures/futures.future_error/what.pass.cpp


Index: test/std/thread/futures/futures.future_error/what.pass.cpp
===================================================================
--- test/std/thread/futures/futures.future_error/what.pass.cpp
+++ test/std/thread/futures/futures.future_error/what.pass.cpp
@@ -26,25 +26,27 @@
 #include <cstring>
 #include <cassert>
 
+#include "test_macros.h"
+
 int main()
 {
     {
         std::future_error f(std::make_error_code(std::future_errc::broken_promise));
-        assert(std::strcmp(f.what(), "The associated promise has been destructed prior "
+        LIBCPP_ASSERT(std::strcmp(f.what(), "The associated promise has been destructed prior "
                       "to the associated state becoming ready.") == 0);
     }
     {
         std::future_error f(std::make_error_code(std::future_errc::future_already_retrieved));
-        assert(std::strcmp(f.what(), "The future has already been retrieved from "
+        LIBCPP_ASSERT(std::strcmp(f.what(), "The future has already been retrieved from "
                       "the promise or packaged_task.") == 0);
     }
     {
         std::future_error f(std::make_error_code(std::future_errc::promise_already_satisfied));
-        assert(std::strcmp(f.what(), "The state of the promise has already been set.") == 0);
+        LIBCPP_ASSERT(std::strcmp(f.what(), "The state of the promise has already been set.") == 0);
     }
     {
         std::future_error f(std::make_error_code(std::future_errc::no_state));
-        assert(std::strcmp(f.what(), "Operation not permitted on an object without "
+        LIBCPP_ASSERT(std::strcmp(f.what(), "Operation not permitted on an object without "
                       "an associated state.") == 0);
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26625.77857.patch
Type: text/x-patch
Size: 1711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161114/e8fa6ecd/attachment.bin>


More information about the cfe-commits mailing list