Commit 22ccd070 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #724

Changes to omt-test pursuant to code review.
Now tests split at |tree|.
Deleted duplicated delete test.

git-svn-id: file:///svn/tokudb@3622 c7de825b-a66e-492c-adef-691d508d4ae1
parent e17a4c1d
...@@ -490,7 +490,7 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close ...@@ -490,7 +490,7 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close
OMT right_split = NULL; OMT right_split = NULL;
test_create_from_sorted_array(create_choice, KEEP_WHEN_DONE); test_create_from_sorted_array(create_choice, KEEP_WHEN_DONE);
for (i = 0; i < length; i++) { for (i = 0; i <= length; i++) {
r = toku_omt_split_at(omt, &right_split, length+1); r = toku_omt_split_at(omt, &right_split, length+1);
CKERR2(r,ERANGE); CKERR2(r,ERANGE);
r = toku_omt_split_at(omt, &right_split, length+2); r = toku_omt_split_at(omt, &right_split, length+2);
...@@ -504,7 +504,6 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close ...@@ -504,7 +504,6 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close
left_split = omt; left_split = omt;
omt = NULL; omt = NULL;
assert(toku_omt_size(left_split) == i); assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(right_split) == length - i); assert(toku_omt_size(right_split) == length - i);
test_fetch_verify(left_split, values, i); test_fetch_verify(left_split, values, i);
test_iterate_verify(left_split, values, i); test_iterate_verify(left_split, values, i);
...@@ -515,12 +514,20 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close ...@@ -515,12 +514,20 @@ void test_split_merge(enum create_type create_choice, enum close_when_done close
// //
r = toku_omt_split_at(left_split, &omt, i+1); r = toku_omt_split_at(left_split, &omt, i+1);
CKERR2(r,ERANGE); CKERR2(r,ERANGE);
assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(right_split) == length - i);
r = toku_omt_split_at(left_split, &omt, i+2); r = toku_omt_split_at(left_split, &omt, i+2);
CKERR2(r,ERANGE); CKERR2(r,ERANGE);
assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(right_split) == length - i);
r = toku_omt_split_at(right_split, &omt, length - i + 1); r = toku_omt_split_at(right_split, &omt, length - i + 1);
CKERR2(r,ERANGE); CKERR2(r,ERANGE);
assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(right_split) == length - i);
r = toku_omt_split_at(right_split, &omt, length - i + 1); r = toku_omt_split_at(right_split, &omt, length - i + 1);
CKERR2(r,ERANGE); CKERR2(r,ERANGE);
assert(toku_omt_size(left_split) == i);
assert(toku_omt_size(right_split) == length - i);
// //
// test merge // test merge
...@@ -572,9 +579,6 @@ void test_create_array(enum create_type create_choice, enum rand_type rand_choic ...@@ -572,9 +579,6 @@ void test_create_array(enum create_type create_choice, enum rand_type rand_choic
test_create_insert( CLOSE_WHEN_DONE); test_create_insert( CLOSE_WHEN_DONE);
/* ********************************************************************** */ /* ********************************************************************** */
init_values(rand_choice); init_values(rand_choice);
test_create_delete_at( create_choice, CLOSE_WHEN_DONE);
/* ********************************************************************** */
init_values(rand_choice);
test_split_merge( create_choice, CLOSE_WHEN_DONE); test_split_merge( create_choice, CLOSE_WHEN_DONE);
} }
......
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