2024-05-29 16:29:08 +10:00
|
|
|
#include <cruft/util/tap.hpp>
|
2018-11-28 15:24:28 +11:00
|
|
|
|
2024-05-29 16:29:08 +10:00
|
|
|
#include <cruft/util/random.hpp>
|
2018-11-28 15:24:28 +11:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
cruft::TAP::logger tap;
|
|
|
|
|
|
|
|
{
|
|
|
|
constexpr int ITERATIONS = 2048;
|
|
|
|
constexpr int HI = 13;
|
|
|
|
constexpr int LO = 3;
|
|
|
|
|
|
|
|
bool success = true;
|
|
|
|
|
|
|
|
for (int i = 0; i < ITERATIONS; ++i) {
|
|
|
|
auto const val = cruft::random::uniform<int> (LO, HI);
|
|
|
|
if (val < LO || val > HI) {
|
|
|
|
std::cerr << val << '\n';
|
|
|
|
success = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tap.expect (success, "default uniform random int is within correct range");
|
|
|
|
}
|
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|