-// Copyright (C) 2020 Free Software Foundation, Inc.
+// Copyright (C) 2020-2022 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <memory>
#include <thread>
#include <cstdio>
+#include <testsuite_random.h>
-bool
-random_device_available(const char* token) noexcept
-{
- try {
- std::random_device dev(token);
- return true;
- } catch (...) {
- std::printf("random_device(\"%s\") not available\n", token);
- return false;
- }
-}
+using __gnu_test::random_device_available;
void read_random_device(const char* token, int iterations)
{
for (auto& w : workers)
w.join();
}
+ else
+ std::printf("random_device(\"%s\") not available\n", dev);
}
}