2019-09-09 18:40:24 +08:00
|
|
|
/*
|
2022-01-15 23:50:22 +08:00
|
|
|
* Copyright 2017-2022 Leonid Yuriev <leo@yuriev.ru>
|
2017-03-30 23:54:57 +08:00
|
|
|
* and other libmdbx authors: please see AUTHORS file.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
2021-03-16 01:52:18 +08: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 23:54:57 +08:00
|
|
|
bool testcase_deadread::run() {
|
2017-04-21 23:41:11 +08:00
|
|
|
db_open();
|
2017-10-27 02:14:29 +08:00
|
|
|
txn_begin(true);
|
2018-11-04 23:57:27 +08:00
|
|
|
cursor_guard.reset();
|
|
|
|
txn_guard.reset();
|
|
|
|
db_guard.reset();
|
2017-03-30 23:54:57 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2021-03-16 01:52:18 +08: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 23:54:57 +08:00
|
|
|
bool testcase_deadwrite::run() {
|
2017-04-21 23:41:11 +08:00
|
|
|
db_open();
|
2017-10-27 02:14:29 +08:00
|
|
|
txn_begin(false);
|
2018-11-04 23:57:27 +08:00
|
|
|
cursor_guard.reset();
|
|
|
|
txn_guard.reset();
|
|
|
|
db_guard.reset();
|
2017-03-30 23:54:57 +08:00
|
|
|
return true;
|
|
|
|
}
|