Commit 4badd7cc authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:3713] merge test changes for #3713 into main, fixes #3713

git-svn-id: file:///svn/toku/tokudb@33013 c7de825b-a66e-492c-adef-691d508d4ae1
parent 52e18dfa
......@@ -97,8 +97,7 @@ static int do_verify_results(DB_TXN *txn, DB *db) {
return r;
}
int test_main(int argc, char * const argv[]) {
parse_args(argc, argv);
static int run_test(BOOL shutdown_before_update, BOOL shutdown_before_verify) {
setup();
DB *db;
......@@ -111,10 +110,26 @@ int test_main(int argc, char * const argv[]) {
CHK(do_inserts(txn_1, db));
});
if (shutdown_before_update) {
CHK(db->close(db, 0));
CHK(db_create(&db, env, 0));
IN_TXN_COMMIT(env, NULL, txn_reopen, 0, {
CHK(db->open(db, txn_reopen, "foo.db", NULL, DB_BTREE, DB_CREATE, 0666));
});
}
IN_TXN_COMMIT(env, NULL, txn_2, 0, {
CHK(do_updates(txn_2, db));
});
if (shutdown_before_verify) {
CHK(db->close(db, 0));
CHK(db_create(&db, env, 0));
IN_TXN_COMMIT(env, NULL, txn_reopen, 0, {
CHK(db->open(db, txn_reopen, "foo.db", NULL, DB_BTREE, DB_CREATE, 0666));
});
}
IN_TXN_COMMIT(env, NULL, txn_3, 0, {
CHK(do_verify_results(txn_3, db));
});
......@@ -125,3 +140,14 @@ int test_main(int argc, char * const argv[]) {
return 0;
}
int test_main(int argc, char * const argv[]) {
parse_args(argc, argv);
run_test(FALSE, FALSE);
run_test(FALSE, TRUE);
run_test(TRUE, FALSE);
run_test(TRUE, TRUE);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment