mdbx-test: add data-check before delete/update.

Change-Id: I5afc1cbd95b5db0b442714229510d6786bf68d43
This commit is contained in:
Leonid Yuriev
2018-09-17 13:06:43 +03:00
parent 68fd9c9908
commit 01ae5bad7d
5 changed files with 23 additions and 1 deletions

View File

@@ -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) {