mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// XFAIL: libcpp-no-exceptions
|
|
||||||
// <random>
|
// <random>
|
||||||
|
|
||||||
// class random_device;
|
// class random_device;
|
||||||
@@ -44,11 +43,13 @@ void check_random_device_valid(const std::string &token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void check_random_device_invalid(const std::string &token) {
|
void check_random_device_invalid(const std::string &token) {
|
||||||
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
try {
|
try {
|
||||||
std::random_device r(token);
|
std::random_device r(token);
|
||||||
LIBCPP_ASSERT(false);
|
LIBCPP_ASSERT(false);
|
||||||
} catch (const std::system_error&) {
|
} catch (const std::system_error&) {
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// XFAIL: libcpp-no-exceptions
|
|
||||||
// <random>
|
// <random>
|
||||||
|
|
||||||
// class random_device;
|
// class random_device;
|
||||||
@@ -26,6 +25,7 @@ int main()
|
|||||||
std::random_device::result_type e = r();
|
std::random_device::result_type e = r();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::random_device r("/dev/null");
|
std::random_device r("/dev/null");
|
||||||
@@ -35,4 +35,5 @@ int main()
|
|||||||
catch (const std::system_error&)
|
catch (const std::system_error&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user