Author: ericwf Date: Tue Jun 14 20:50:31 2016 New Revision: 272746 URL: http://llvm.org/viewvc/llvm-project?rev=272746&view=rev Log: Improve portability of random_device tests. Patch from s...@microsoft.com
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=272746&r1=272745&r2=272746&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 Jun 14 20:50:31 2016 @@ -27,6 +27,8 @@ #include <unistd.h> #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 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&) { } } 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=272746&r1=272745&r2=272746&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 Jun 14 20:50:31 2016 @@ -17,6 +17,8 @@ #include <random> #include <cassert> +#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&) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits