mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-19 19:39:26 +08:00
mdbx: новые настройки clang-format (косметика).
This commit is contained in:
@@ -14,9 +14,7 @@ bool registry::add(const record *item) {
|
||||
auto const singleton = instance();
|
||||
assert(singleton->name2id.count(std::string(item->name)) == 0);
|
||||
assert(singleton->id2record.count(item->id) == 0);
|
||||
if (singleton->name2id.count(std::string(item->name)) +
|
||||
singleton->id2record.count(item->id) ==
|
||||
0) {
|
||||
if (singleton->name2id.count(std::string(item->name)) + singleton->id2record.count(item->id) == 0) {
|
||||
singleton->name2id[std::string(item->name)] = item;
|
||||
singleton->id2record[item->id] = item;
|
||||
return true;
|
||||
@@ -24,28 +22,24 @@ bool registry::add(const record *item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
testcase *registry::create_actor(const actor_config &config,
|
||||
const mdbx_pid_t pid) {
|
||||
testcase *registry::create_actor(const actor_config &config, const mdbx_pid_t pid) {
|
||||
return instance()->id2record.at(config.testcase)->constructor(config, pid);
|
||||
}
|
||||
|
||||
bool registry::review_actor_params(const actor_testcase id,
|
||||
actor_params ¶ms,
|
||||
const unsigned space_id) {
|
||||
bool registry::review_actor_params(const actor_testcase id, actor_params ¶ms, const unsigned space_id) {
|
||||
return instance()->id2record.at(id)->review_params(params, space_id);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void configure_actor(unsigned &last_space_id, const actor_testcase testcase,
|
||||
const char *space_id_cstr, actor_params params) {
|
||||
void configure_actor(unsigned &last_space_id, const actor_testcase testcase, const char *space_id_cstr,
|
||||
actor_params params) {
|
||||
unsigned wait4id = 0;
|
||||
if (params.waitfor_nops) {
|
||||
for (auto i = global::actors.rbegin(); i != global::actors.rend(); ++i) {
|
||||
if (i->is_waitable(params.waitfor_nops)) {
|
||||
if (i->signal_nops && i->signal_nops != params.waitfor_nops)
|
||||
failure("Previous waitable actor (id=%u) already linked on %u-ops\n",
|
||||
i->actor_id, i->signal_nops);
|
||||
failure("Previous waitable actor (id=%u) already linked on %u-ops\n", i->actor_id, i->signal_nops);
|
||||
wait4id = i->actor_id;
|
||||
i->signal_nops = params.waitfor_nops;
|
||||
break;
|
||||
@@ -75,15 +69,12 @@ void configure_actor(unsigned &last_space_id, const actor_testcase testcase,
|
||||
failure("Actor config-review failed for space-id %lu\n", space_id);
|
||||
|
||||
last_space_id = unsigned(space_id);
|
||||
log_trace("configure_actor: space %lu for %s", space_id,
|
||||
testcase2str(testcase));
|
||||
global::actors.emplace_back(
|
||||
actor_config(testcase, params, unsigned(space_id), wait4id));
|
||||
log_trace("configure_actor: space %lu for %s", space_id, testcase2str(testcase));
|
||||
global::actors.emplace_back(actor_config(testcase, params, unsigned(space_id), wait4id));
|
||||
global::databases.insert(params.pathname_db);
|
||||
}
|
||||
|
||||
void testcase_setup(const char *casename, const actor_params ¶ms,
|
||||
unsigned &last_space_id) {
|
||||
void testcase_setup(const char *casename, const actor_params ¶ms, unsigned &last_space_id) {
|
||||
if (strcmp(casename, "basic") == 0) {
|
||||
log_notice(">>> testcase_setup(%s)", casename);
|
||||
configure_actor(last_space_id, ac_nested, nullptr, params);
|
||||
@@ -111,8 +102,7 @@ void keycase_setup(const char *casename, actor_params ¶ms) {
|
||||
params.keygen.keycase = kc_random;
|
||||
// TODO
|
||||
log_notice("<<< keycase_setup(%s): done", casename);
|
||||
} else if (strcmp(casename, "dashes") == 0 ||
|
||||
strcmp(casename, "aside") == 0) {
|
||||
} else if (strcmp(casename, "dashes") == 0 || strcmp(casename, "aside") == 0) {
|
||||
log_notice(">>> keycase_setup(%s)", casename);
|
||||
params.keygen.keycase = kc_dashes;
|
||||
// TODO
|
||||
|
Reference in New Issue
Block a user