diff options
author | Jack Lloyd <[email protected]> | 2017-09-29 19:31:44 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-29 19:31:44 -0400 |
commit | 6ed189c4767f4d4769a15877220dcb571dfcc37e (patch) | |
tree | 9b1ed3d910a3877eaa70d82dbcdc707b91194e19 /src/tests/main.cpp | |
parent | e4e077290cff8e2ce8ef174f41bae94e4106adf6 (diff) |
Avoid using std::rand in test code
It makes static analyzers mad
Diffstat (limited to 'src/tests/main.cpp')
-rw-r--r-- | src/tests/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tests/main.cpp b/src/tests/main.cpp index d3c3a0916..51fa11374 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -11,7 +11,6 @@ #include <string> #include <set> #include <deque> -#include <cstdlib> #include <botan/version.h> #include <botan/loadstor.h> @@ -122,9 +121,12 @@ class Test_Runner final : public Botan_CLI::Command { for(size_t i = 0; i != len; ++i) { - out[i] = std::rand(); + m_x = (m_x * 31337 + 42); + out[i] = static_cast<uint8_t>(m_x >> 7); } } + private: + uint32_t m_x = 1; }; output() << " rng:bogus\n"; |