2019-09-09 13:40:24 +03:00
|
|
|
/*
|
2024-03-13 14:57:38 +03:00
|
|
|
* Copyright 2017-2024 Leonid Yuriev <leo@yuriev.ru>
|
2017-03-30 18:54:57 +03: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>.
|
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
}
|