mdbx-testing: устранение лишней установки prng при завершении цикла тестов.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-11-16 11:21:27 +03:00
parent f32d3f260f
commit f5b1e36b9e

View File

@ -815,6 +815,10 @@ static bool execute_thunk(const actor_config *const_config,
std::unique_ptr<testcase> test(registry::create_actor(config, pid)); std::unique_ptr<testcase> test(registry::create_actor(config, pid));
size_t iter = 0; size_t iter = 0;
do { do {
if (iter) {
prng_seed(config.params.prng_seed += INT32_C(0xA4F4D37B));
log_verbose("turn PRNG to %u", config.params.prng_seed);
}
iter++; iter++;
if (!test->setup()) { if (!test->setup()) {
log_notice("test setup failed"); log_notice("test setup failed");
@ -837,8 +841,6 @@ static bool execute_thunk(const actor_config *const_config,
size_t(config.params.nrepeat)); size_t(config.params.nrepeat));
else else
log_verbose("test successfully (iteration %zi)", iter); log_verbose("test successfully (iteration %zi)", iter);
prng_seed(config.params.prng_seed += INT32_C(0xA4F4D37B));
log_verbose("turn PRNG to %u", config.params.prng_seed);
} }
} while (config.params.nrepeat == 0 || iter < config.params.nrepeat); } while (config.params.nrepeat == 0 || iter < config.params.nrepeat);
@ -856,7 +858,7 @@ bool test_execute(const actor_config &config) {
return execute_thunk(&config, osal_getpid()); return execute_thunk(&config, osal_getpid());
#ifdef _MSC_VER #ifdef _MSC_VER
} __except (seh_filter(GetExceptionInformation(), stderr)) { } __except (seh_filter(GetExceptionInformation(), stderr)) {
fprintf(stderr, "Exception \n"); fprintf(stderr, "Exception\n");
return false; return false;
} }
#endif #endif