45#define log_rand log_debug
48#define STD_RAND_VALUE_LOG(_c, _s, _nr, _f, _l) \
49 log_rand("%s(%lu) = %lu at %s:%d", _c, \
50 (unsigned long) _s, (unsigned long) _nr, \
68#define RAND_VALUE_LOG(_c, _s, _nr, _f, _l) \
69 if (randlog_enabled) { \
70 log_normal("%lu -> %lu %s:%d", \
71 (unsigned long) _s, (unsigned long) _nr, \
72 fc_basename(_f), _l); \
74 STD_RAND_VALUE_LOG(_c, _s, _nr, _f, _l); \
77#define RAND_VALUE_LOG STD_RAND_VALUE_LOG
115 int line,
const char *file)
138 log_error(
"%s(%lu) = %lu bailout at %s:%d",
167 for (
i = 1;
i < 56;
i++) {
184 for (
i = 0;
i < 10000;
i++) {
212 log_rand(
"fc_rand_state J=%d K=%d X=%d",
214 for (
i = 0;
i < 8;
i++) {
215 log_rand(
"fc_rand_state %d, %08x %08x %08x %08x %08x %08x %08x",
235 log_rand(
"fc_rand_set_state J=%d K=%d X=%d",
237 for (
i = 0;
i < 8;
i++) {
238 log_rand(
"fc_rand_set_state %d, %08x %08x %08x %08x %08x %08x %08x",
263 for (
i = 0;
i <
n + 2;
i++) {
278 log_test(
"test_random1(%d) same: %d, change: %d",
294 int line,
const char *file)
298#define LARGE_PRIME (10007)
299#define SMALL_PRIME (1009)
307 log_rand(
"%s(%lu,%lu) = %lu at %s:%d",
309 (
unsigned long) result, file,
line);
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
bool fc_rand_is_init(void)
RANDOM_STATE fc_rand_state(void)
RANDOM_TYPE fc_rand_debug(RANDOM_TYPE size, const char *called_as, int line, const char *file)
void fc_srand(RANDOM_TYPE seed)
RANDOM_TYPE fc_randomly_debug(RANDOM_TYPE seed, RANDOM_TYPE size, const char *called_as, int line, const char *file)
static RANDOM_STATE rand_state
void fc_rand_uninit(void)
void fc_rand_set_state(RANDOM_STATE state)