aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r--src/tests/tests.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index 99a4d8e3a..9ed6785bc 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -2,10 +2,26 @@
#include <botan/init.h>
#include <iostream>
#include <fstream>
+#include <botan/auto_rng.h>
+
+#if defined(BOTAN_HAS_SYSTEM_RNG)
+ #include <botan/system_rng.h>
+#endif
+
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
+Botan::RandomNumberGenerator& test_rng()
+ {
+#if defined(BOTAN_HAS_SYSTEM_RNG)
+ return Botan::system_rng();
+#else
+ static AutoSeeded_RNG rng;
+ return rng;
+#endif
+ }
+
std::vector<std::string> list_dir(const std::string& dir_path)
{
std::vector<std::string> paths;