Commit d72ee044 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #479

Fixed some tests for tlogn range trees.

git-svn-id: file:///svn/tokudb@2708 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9ac4686e
...@@ -92,7 +92,7 @@ HEADERS=../rangetree.h ../rangetree-internal.h test.h ...@@ -92,7 +92,7 @@ HEADERS=../rangetree.h ../rangetree-internal.h test.h
%.lin: %.c $(HEADERS) $(LINEAR_BINS) %.lin: %.c $(HEADERS) $(LINEAR_BINS)
cc -DDIR=\"dir.$<.lin\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINEAR_BINS) cc -DDIR=\"dir.$<.lin\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINEAR_BINS)
%.tlog: %.c $(HEADERS) $(TLOG_BINS) %.tlog: %.c $(HEADERS) $(TLOG_BINS)
cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(TLOG_BINS) cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(TLOG_BINS) -DTOKU_RT_NOOVERLAPS
%.log: %.c $(HEADERS) $(LOG_BINS) %.log: %.c $(HEADERS) $(LOG_BINS)
cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LOG_BINS) cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LOG_BINS)
......
...@@ -11,6 +11,9 @@ int main(int argc, const char *argv[]) { ...@@ -11,6 +11,9 @@ int main(int argc, const char *argv[]) {
parse_args(argc, argv); parse_args(argc, argv);
for (allow_overlaps = 0; allow_overlaps < 2; allow_overlaps++) { for (allow_overlaps = 0; allow_overlaps < 2; allow_overlaps++) {
#ifdef TOKU_RT_NOOVERLAPS
if (allow_overlaps) continue;
#endif
r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, malloc, free, realloc); r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, malloc, free, realloc);
CKERR(r); CKERR(r);
...@@ -26,6 +29,9 @@ int main(int argc, const char *argv[]) { ...@@ -26,6 +29,9 @@ int main(int argc, const char *argv[]) {
} }
for (allow_overlaps = 0; allow_overlaps < 2; allow_overlaps++) { for (allow_overlaps = 0; allow_overlaps < 2; allow_overlaps++) {
#ifdef TOKU_RT_NOOVERLAPS
if (allow_overlaps) continue;
#endif
int i; int i;
for (i = 1; i <= 2; i++) { for (i = 1; i <= 2; i++) {
mallocced = 0; mallocced = 0;
......
...@@ -123,6 +123,7 @@ int main(int argc, const char *argv[]) { ...@@ -123,6 +123,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r); r = toku_rt_close(tree); CKERR(r);
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, ptr_cmp, TRUE, malloc, free, realloc); r = toku_rt_create(&tree, int_cmp, ptr_cmp, TRUE, malloc, free, realloc);
CKERR(r); CKERR(r);
assert(tree != NULL); assert(tree != NULL);
...@@ -132,6 +133,9 @@ int main(int argc, const char *argv[]) { ...@@ -132,6 +133,9 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r); r = toku_rt_close(tree); CKERR(r);
tree = NULL;
#endif
/* Successor tests */ /* Successor tests */
r = toku_rt_create(&tree, int_cmp, ptr_cmp, FALSE, malloc, free, realloc); r = toku_rt_create(&tree, int_cmp, ptr_cmp, FALSE, malloc, free, realloc);
...@@ -152,6 +156,7 @@ int main(int argc, const char *argv[]) { ...@@ -152,6 +156,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r); r = toku_rt_close(tree); CKERR(r);
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, ptr_cmp, TRUE, malloc, free, realloc); r = toku_rt_create(&tree, int_cmp, ptr_cmp, TRUE, malloc, free, realloc);
CKERR(r); CKERR(r);
assert(tree != NULL); assert(tree != NULL);
...@@ -162,7 +167,7 @@ int main(int argc, const char *argv[]) { ...@@ -162,7 +167,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r); r = toku_rt_close(tree); CKERR(r);
tree = NULL; tree = NULL;
#endif
/* Get allow overlap */ /* Get allow overlap */
BOOL allowed; BOOL allowed;
......
...@@ -20,6 +20,7 @@ int main(int argc, const char *argv[]) { ...@@ -20,6 +20,7 @@ int main(int argc, const char *argv[]) {
|-------A-------| |-------A-------|
|-------B-------| |-------B-------|
*/ */
#ifndef TOKU_RT_NOOVERLAPS
r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, malloc, free, realloc); r = toku_rt_create(&tree, int_cmp, char_cmp, TRUE, malloc, free, realloc);
CKERR(r); CKERR(r);
...@@ -104,7 +105,7 @@ int main(int argc, const char *argv[]) { ...@@ -104,7 +105,7 @@ int main(int argc, const char *argv[]) {
r = toku_rt_close(tree); CKERR(r); r = toku_rt_close(tree); CKERR(r);
tree = NULL; tree = NULL;
#endif
/* Test no overlap case. */ /* Test no overlap case. */
/* /*
1 2 3 4 5 6 7 1 2 3 4 5 6 7
......
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