Commit 5dfdc1bc authored by Yoni Fogel's avatar Yoni Fogel

Closes #288

Fixed minor bugs in tests.

git-svn-id: file:///svn/tokudb@1777 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0cf40db2
......@@ -22,7 +22,7 @@ endif
LIBNAME=librt.$(LIBEXT)
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS = -Wall -Werror $(OPTFLAGS) -g $(GCOV_FLAGS)
CFLAGS = -Wall -Werror $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CPPFLAGS += -L../ -I../ -I../../../newbrt -lpthread
......
......@@ -153,8 +153,8 @@ int main(int argc, const char *argv[]) {
verify_all_overlap(&find_range, buf, found);
/* Verify the right one is still there, and the wrong one is not there. */
assert(*(int*)buf[0].left == 1 &&
*(int*)buf[0].right == 5 &&
assert(*(int*)buf[0].left == 3 &&
*(int*)buf[0].right == 7 &&
*(char*)buf[0].data == letters[0]);
range.left = &nums[3];
......@@ -180,6 +180,10 @@ int main(int argc, const char *argv[]) {
|---A---|
|---B---|
*/
find_range.left = &nums[3];
find_range.right = &nums[4];
find_range.data = NULL;
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE);
CKERR(r);
......
......@@ -50,9 +50,9 @@ void runsearch(int rexpect, toku_range* query, toku_range* expect) {
if (rexpect != 0) return;
assert(found == 1);
assert(int_cmp(&buf[0].left, expect->left) == 0 &&
int_cmp(&buf[0].right, expect->right) == 0 &&
char_cmp(&buf[0].data, expect->data) == 0);
assert(int_cmp(buf[0].left, expect->left) == 0 &&
int_cmp(buf[0].right, expect->right) == 0 &&
char_cmp(buf[0].data, expect->data) == 0);
}
void runinsert(int rexpect, toku_range* toinsert) {
......
......@@ -47,9 +47,9 @@ void runsearch(int rexpect, toku_range* query, toku_range* expect) {
if (rexpect != 0) return;
assert(found == 1);
assert(int_cmp(&buf[0].left, expect->left) == 0 &&
int_cmp(&buf[0].right, expect->right) == 0 &&
char_cmp(&buf[0].data, expect->data) == 0);
assert(int_cmp(buf[0].left, expect->left) == 0 &&
int_cmp(buf[0].right, expect->right) == 0 &&
char_cmp(buf[0].data, expect->data) == 0);
}
void runinsert(int rexpect, toku_range* toinsert) {
......@@ -132,9 +132,9 @@ void tests(BOOL allow_overlaps) {
runsearch(0, init_range(&query, 0, 3, -1), init_range(&expect, 0, 3, 0));
close_tree();
/* Tree: {|0-3|}, insert of of |0-3| success == allow_overlaps */
/* Tree: {(|0-3|,0)}, insert of of (|0-3|,1) success == allow_overlaps */
setup_tree(allow_overlaps, 0, 3, 0);
runinsert((allow_overlaps ? 0 : EDOM), init_range(&query, 0, 3, -1));
runinsert((allow_overlaps ? 0 : EDOM), init_range(&expect, 0, 3, 1));
close_tree();
}
......
......@@ -54,9 +54,9 @@ void runsearch(int rexpect, toku_range* query, toku_range* expect) {
if (rexpect != 0) return;
assert(found == 1);
assert(int_cmp(&buf[0].left, expect->left) == 0 &&
int_cmp(&buf[0].right, expect->right) == 0 &&
char_cmp(&buf[0].data, expect->data) == 0);
assert(int_cmp(buf[0].left, expect->left) == 0 &&
int_cmp(buf[0].right, expect->right) == 0 &&
char_cmp(buf[0].data, expect->data) == 0);
}
void runinsert(int rexpect, toku_range* toinsert) {
......
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