[libcxx] r285677 - Protect tests that expect an exception for an unknown std::random_device

Roger Ferrer Ibanez via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 01:11:13 PDT 2016


Author: rogfer01
Date: Tue Nov  1 03:11:12 2016
New Revision: 285677

URL: http://llvm.org/viewvc/llvm-project?rev=285677&view=rev
Log:
Protect tests that expect an exception for an unknown std::random_device

Skip these tests under libcpp-no-exceptions.

Differential Revision: https://reviews.llvm.org/D26141


Modified:
    libcxx/trunk/test/std/numerics/rand/rand.device/ctor.pass.cpp
    libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp

Modified: libcxx/trunk/test/std/numerics/rand/rand.device/ctor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.device/ctor.pass.cpp?rev=285677&r1=285676&r2=285677&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.device/ctor.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.device/ctor.pass.cpp Tue Nov  1 03:11:12 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <random>
 
 // class random_device;
@@ -44,11 +43,13 @@ void check_random_device_valid(const std
 }
 
 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
 }
 
 

Modified: libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp?rev=285677&r1=285676&r2=285677&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/rand/rand.device/eval.pass.cpp Tue Nov  1 03:11:12 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <random>
 
 // class random_device;
@@ -26,6 +25,7 @@ int main()
         std::random_device::result_type e = r();
     }
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try
     {
         std::random_device r("/dev/null");
@@ -35,4 +35,5 @@ int main()
     catch (const std::system_error&)
     {
     }
+#endif
 }




More information about the cfe-commits mailing list