summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/rand/rand.device/ctor.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/numerics/rand/rand.device/ctor.pass.cpp')
-rw-r--r--libcxx/test/numerics/rand/rand.device/ctor.pass.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcxx/test/numerics/rand/rand.device/ctor.pass.cpp b/libcxx/test/numerics/rand/rand.device/ctor.pass.cpp
index a7c38d4c165..dfa546be709 100644
--- a/libcxx/test/numerics/rand/rand.device/ctor.pass.cpp
+++ b/libcxx/test/numerics/rand/rand.device/ctor.pass.cpp
@@ -15,6 +15,7 @@
#include <random>
#include <cassert>
+#include <unistd.h>
int main()
{
@@ -30,6 +31,16 @@ int main()
std::random_device r;
}
{
+ int ec;
+ ec = close(STDIN_FILENO);
+ assert(!ec);
+ ec = close(STDOUT_FILENO);
+ assert(!ec);
+ ec = close(STDERR_FILENO);
+ assert(!ec);
+ std::random_device r;
+ }
+ {
std::random_device r("/dev/urandom");;
}
{
OpenPOWER on IntegriCloud