X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Ftestsuite%2F26_numerics%2Frandom%2Frandom_device%2F94087.cc;h=0ece3fd4cbe1c21b89422148ad61025d9fc49a84;hb=7adcbafe45f8001b698967defe682687b52c0007;hp=cfcc261906e94fc4199dba3c2b8e1f314dff458b;hpb=a2d196e75cef95c2b70734ad02e94f9da0e769fe;p=thirdparty%2Fgcc.git diff --git a/libstdc++-v3/testsuite/26_numerics/random/random_device/94087.cc b/libstdc++-v3/testsuite/26_numerics/random/random_device/94087.cc index cfcc261906e9..0ece3fd4cbe1 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/random_device/94087.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/random_device/94087.cc @@ -1,4 +1,4 @@ -// 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 @@ -25,18 +25,9 @@ #include #include #include +#include -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) { @@ -59,5 +50,7 @@ int main() { for (auto& w : workers) w.join(); } + else + std::printf("random_device(\"%s\") not available\n", dev); } }