mirror of
https://github.com/isar/libmdbx.git
synced 2025-12-20 18:32:21 +08:00
mdbx-test: add params-review by actors.
Change-Id: I79fb6cb19c73facd8cc8cefc3bf3101e9d0c672c
This commit is contained in:
@@ -40,22 +40,15 @@ testcase *registry::create_actor(const actor_config &config,
|
||||
return instance()->id2record.at(config.testcase)->constructor(config, pid);
|
||||
}
|
||||
|
||||
bool registry::review_actor_config(actor_config &config) {
|
||||
return instance()->id2record.at(config.testcase)->review_config(config);
|
||||
bool registry::review_actor_params(const actor_testcase id,
|
||||
actor_params ¶ms) {
|
||||
return instance()->id2record.at(id)->review_params(params);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void configure_actor(unsigned &last_space_id, const actor_testcase testcase,
|
||||
const char *space_id_cstr, actor_params params) {
|
||||
// silently fix key/data length for fixed-length modes
|
||||
if ((params.table_flags & MDBX_INTEGERKEY) &&
|
||||
params.keylen_min != params.keylen_max)
|
||||
params.keylen_min = params.keylen_max;
|
||||
if ((params.table_flags & (MDBX_INTEGERDUP | MDBX_DUPFIXED)) &&
|
||||
params.datalen_min != params.datalen_max)
|
||||
params.datalen_min = params.datalen_max;
|
||||
|
||||
unsigned wait4id = 0;
|
||||
if (params.waitfor_nops) {
|
||||
for (auto i = global::actors.rbegin(); i != global::actors.rend(); ++i) {
|
||||
@@ -85,6 +78,9 @@ void configure_actor(unsigned &last_space_id, const actor_testcase testcase,
|
||||
failure("The '%s' is unexpected for space-id\n", end);
|
||||
}
|
||||
|
||||
if (!registry::review_actor_params(testcase, params))
|
||||
failure("Actor config-review failed for space-id %u\n", space_id);
|
||||
|
||||
if (space_id > ACTOR_ID_MAX)
|
||||
failure("Invalid space-id %u\n", space_id);
|
||||
last_space_id = space_id;
|
||||
|
||||
Reference in New Issue
Block a user