mirror of
https://github.com/isar/libmdbx.git
synced 2025-12-17 17:32:24 +08:00
mdbx-test: add data-check before delete/update.
Change-Id: I5afc1cbd95b5db0b442714229510d6786bf68d43
This commit is contained in:
10
test/test.cc
10
test/test.cc
@@ -410,6 +410,16 @@ void testcase::db_table_close(MDBX_dbi handle) {
|
||||
log_trace("<< testcase::db_table_close");
|
||||
}
|
||||
|
||||
void testcase::checkdata(const char *step, MDBX_dbi handle, MDBX_val key,
|
||||
MDBX_val expect) {
|
||||
MDBX_val data = expect;
|
||||
int rc = mdbx_get2(txn_guard.get(), handle, &key, &data);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror(step, rc);
|
||||
if (!is_samedata(&data, &expect))
|
||||
failure("%s data mismatch", step);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool test_execute(const actor_config &config) {
|
||||
|
||||
Reference in New Issue
Block a user