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