From 42e3e187f58dad28d2049ef1032bc87b9ef78d64 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 15 Jun 2016 01:50:31 +0000 Subject: [PATCH] Improve portability of random_device tests. Patch from STL@microsoft.com git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272746 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/std/numerics/rand/rand.device/ctor.pass.cpp | 4 +++- test/std/numerics/rand/rand.device/eval.pass.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/std/numerics/rand/rand.device/ctor.pass.cpp b/test/std/numerics/rand/rand.device/ctor.pass.cpp index 9709484eb..8c45bb19a 100644 --- a/test/std/numerics/rand/rand.device/ctor.pass.cpp +++ b/test/std/numerics/rand/rand.device/ctor.pass.cpp @@ -27,6 +27,8 @@ #include #endif +#include "test_macros.h" + bool is_valid_random_device(const std::string &token) { #if defined(_LIBCPP_USING_DEV_RANDOM) @@ -44,7 +46,7 @@ void check_random_device_valid(const std::string &token) { void check_random_device_invalid(const std::string &token) { try { std::random_device r(token); - assert(false); + LIBCPP_ASSERT(false); } catch (const std::system_error&) { } } diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp index e319e0f4e..eabcc201e 100644 --- a/test/std/numerics/rand/rand.device/eval.pass.cpp +++ b/test/std/numerics/rand/rand.device/eval.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + int main() { { @@ -28,7 +30,7 @@ int main() { std::random_device r("/dev/null"); r(); - assert(false); + LIBCPP_ASSERT(false); } catch (const std::system_error&) {