Commit dd758c2e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4403], make test change fo put_with_dep_pairs

git-svn-id: file:///svn/toku/tokudb@38940 c7de825b-a66e-492c-adef-691d508d4ae1
parent a077e8dc
......@@ -68,7 +68,7 @@ static void get_key_and_fullhash(CACHEKEY* cachekey, u_int32_t* fullhash, void*
static void
cachetable_test (BOOL write_first, BOOL write_second) {
cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
const int test_limit = 12;
int r;
CACHETABLE ct;
......@@ -100,10 +100,12 @@ cachetable_test (BOOL write_first, BOOL write_second) {
enum cachetable_dirty cd[2];
cd[0] = write_first ? CACHETABLE_DIRTY : CACHETABLE_CLEAN;
cd[1] = write_second ? CACHETABLE_DIRTY : CACHETABLE_CLEAN;
//
// should mark the v1 and v2 as pending
//
r = toku_cachetable_begin_checkpoint(ct, NULL); assert(r==0);
if (start_checkpoint) {
//
// should mark the v1 and v2 as pending
//
r = toku_cachetable_begin_checkpoint(ct, NULL); assert(r==0);
}
//
// This call should cause a flush for both
//
......@@ -136,24 +138,27 @@ cachetable_test (BOOL write_first, BOOL write_second) {
assert(put_key.b == 3);
assert(put_fullhash == 3);
assert(v1_written == write_first);
assert(v2_written == write_second);
if (start_checkpoint) {
assert(v1_written == write_first);
assert(v2_written == write_second);
}
check_me = FALSE;
r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8));
r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(8));
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
assert(r==0);
if (start_checkpoint) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
assert(r==0);
}
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
......@@ -165,9 +170,13 @@ cachetable_test (BOOL write_first, BOOL write_second) {
int
test_main(int argc, const char *argv[]) {
default_parse_args(argc, argv);
cachetable_test(FALSE,FALSE);
cachetable_test(FALSE,TRUE);
cachetable_test(TRUE,FALSE);
cachetable_test(TRUE,TRUE);
cachetable_test(FALSE,FALSE,TRUE);
cachetable_test(FALSE,TRUE,TRUE);
cachetable_test(TRUE,FALSE,TRUE);
cachetable_test(TRUE,TRUE,TRUE);
cachetable_test(FALSE,FALSE,FALSE);
cachetable_test(FALSE,TRUE,FALSE);
cachetable_test(TRUE,FALSE,FALSE);
cachetable_test(TRUE,TRUE,FALSE);
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