[PATCH] D26141: Protect tests that expect an exception for an unknown std::random_device

Roger Ferrer Ibanez via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 04:15:51 PDT 2016


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

Skip these tests under libcpp-no-exceptions.


https://reviews.llvm.org/D26141

Files:
  test/std/numerics/rand/rand.device/ctor.pass.cpp
  test/std/numerics/rand/rand.device/eval.pass.cpp


Index: test/std/numerics/rand/rand.device/eval.pass.cpp
===================================================================
--- test/std/numerics/rand/rand.device/eval.pass.cpp
+++ test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <random>
 
 // class random_device;
@@ -26,6 +25,7 @@
         std::random_device::result_type e = r();
     }
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try
     {
         std::random_device r("/dev/null");
@@ -35,4 +35,5 @@
     catch (const std::system_error&)
     {
     }
+#endif
 }
Index: test/std/numerics/rand/rand.device/ctor.pass.cpp
===================================================================
--- test/std/numerics/rand/rand.device/ctor.pass.cpp
+++ test/std/numerics/rand/rand.device/ctor.pass.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <random>
 
 // class random_device;
@@ -44,11 +43,13 @@
 }
 
 void check_random_device_invalid(const std::string &token) {
+#ifndef TEST_HAS_NO_EXCEPTIONS
   try {
     std::random_device r(token);
     LIBCPP_ASSERT(false);
   } catch (const std::system_error&) {
   }
+#endif
 }
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26141.76378.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/124ccc7c/attachment.bin>


More information about the cfe-commits mailing list