2024-05-19 22:07:58 +03:00
|
|
|
/// \author Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru> \date 2015-2024
|
|
|
|
/// \copyright SPDX-License-Identifier: Apache-2.0
|
2017-03-30 18:54:57 +03:00
|
|
|
|
2022-11-08 16:17:14 +03:00
|
|
|
#include "test.h++"
|
2017-03-30 18:54:57 +03:00
|
|
|
|
2021-03-15 20:52:18 +03:00
|
|
|
class testcase_deadread : public testcase {
|
|
|
|
public:
|
|
|
|
testcase_deadread(const actor_config &config, const mdbx_pid_t pid)
|
|
|
|
: testcase(config, pid) {}
|
|
|
|
bool run() override;
|
|
|
|
};
|
|
|
|
REGISTER_TESTCASE(deadread);
|
|
|
|
|
2017-03-30 18:54:57 +03:00
|
|
|
bool testcase_deadread::run() {
|
2017-04-21 18:41:11 +03:00
|
|
|
db_open();
|
2017-10-26 21:14:29 +03:00
|
|
|
txn_begin(true);
|
2018-11-04 18:57:27 +03:00
|
|
|
cursor_guard.reset();
|
|
|
|
txn_guard.reset();
|
|
|
|
db_guard.reset();
|
2017-03-30 18:54:57 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2021-03-15 20:52:18 +03:00
|
|
|
class testcase_deadwrite : public testcase {
|
|
|
|
public:
|
|
|
|
testcase_deadwrite(const actor_config &config, const mdbx_pid_t pid)
|
|
|
|
: testcase(config, pid) {}
|
|
|
|
bool run() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_TESTCASE(deadwrite);
|
|
|
|
|
2017-03-30 18:54:57 +03:00
|
|
|
bool testcase_deadwrite::run() {
|
2017-04-21 18:41:11 +03:00
|
|
|
db_open();
|
2017-10-26 21:14:29 +03:00
|
|
|
txn_begin(false);
|
2018-11-04 18:57:27 +03:00
|
|
|
cursor_guard.reset();
|
|
|
|
txn_guard.reset();
|
|
|
|
db_guard.reset();
|
2017-03-30 18:54:57 +03:00
|
|
|
return true;
|
|
|
|
}
|