Commit eb7c3abf authored by Yoni Fogel's avatar Yoni Fogel

Lock tree tests ported to no overlap (TLINEAR and TLOG)

Minor makefile modifications.

git-svn-id: file:///svn/tokudb@2560 c7de825b-a66e-492c-adef-691d508d4ae1
parent 891411a7
......@@ -102,14 +102,14 @@ LT_BINS = ../lth.o ../rth.o
LT_OVERLAP = ../locktree_global_readset.o
LT_NOOVERLAP = ../locktree_no_global_readset.o
LT_LINEAR = $(LT_OVERLAP) $(LT_BINS) $(RT_LINEAR_BINS)
LT_TLINEAR = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLINEAR_BINS)
LT_TLOG = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLOG_BINS)
LT_TLINEAR = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLINEAR_BINS) -DTOKU_RT_NOOVERLAPS
LT_TLOG = $(LT_NOOVERLAP) $(LT_BINS) $(RT_TLOG_BINS) -DTOKU_RT_NOOVERLAPS
LT_LOG = $(LT_OVERLAP) $(LT_BINS) $(RT_LOG_BINS)
%.lin: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.lin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR)
%.tlin: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.tlin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR)
cc -DDIR=\"dir.$<.tlin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLINEAR)
%.tlog: %.c ../locktree.h test.h
cc -DDIR=\"dir.$<.tlog\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLOG)
%.log: %.c ../locktree.h test.h
......
......@@ -266,6 +266,7 @@ void runtest(BOOL dups) {
dups ? 3 : 7, 7,
txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread;
assert(rt);
......@@ -273,6 +274,7 @@ void runtest(BOOL dups) {
3, 3,
dups ? 3 : 7, 7,
txn);
#endif
close_tree();
/* ************************************** */
......@@ -297,12 +299,14 @@ void runtest(BOOL dups) {
dups ? 3 : 7, 7,
txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1,
3, 3,
dups ? 3 : 7, 7,
txn);
#endif
rt = NULL;
close_tree();
/* ************************************** */
......@@ -313,9 +317,11 @@ void runtest(BOOL dups) {
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 2, 3, 3, 3, 3, txn);
lt_find(dups, rt, 2, 4, 4, 4, 4, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 2, 3, 3, 3, 3, txn);
lt_find(dups, rt, 2, 4, 4, 4, 4, txn);
#endif
rt = NULL;
close_tree();
/* ************************************** */
......@@ -328,15 +334,19 @@ void runtest(BOOL dups) {
for (i = 0; i < 20; i += 2) {
lt_find(dups, rt, 10, i, 5, i + 1, 10, txn);
}
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
for (i = 0; i < 20; i += 2) {
lt_find(dups, rt, 10, i, 5, i + 1, 10, txn);
}
#endif
lt_insert(dups, 0, neg_infinite, 20, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find( dups, rt, 1, 0, neg_infinite, 20, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find( dups, rt, 1, 0, neg_infinite, 20, infinite, txn);
#endif
rt = NULL;
close_tree();
/* ************************************** */
......@@ -350,16 +360,20 @@ void runtest(BOOL dups) {
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 2, 0, neg_infinite, 2, infinite, txn);
lt_find(dups, rt, 2, 3, neg_infinite, 5, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 2, 0, neg_infinite, 2, infinite, txn);
lt_find(dups, rt, 2, 3, neg_infinite, 5, infinite, txn);
#endif
lt_insert(dups, 2, neg_infinite, 3, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, 0, neg_infinite, 5, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, 0, neg_infinite, 5, infinite, txn);
#endif
rt = NULL;
close_tree();
/* ************************************** */
......@@ -369,8 +383,10 @@ void runtest(BOOL dups) {
lt_insert(dups, 2, neg_infinite, 5, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 6, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 6, infinite, txn);
#endif
close_tree();
setup_tree(dups);
......@@ -380,8 +396,10 @@ void runtest(BOOL dups) {
lt_insert(dups, 2, neg_infinite, 7, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, neg_infinite, neg_infinite, 8, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, neg_infinite, neg_infinite, 8, infinite, txn);
#endif
close_tree();
setup_tree(dups);
......@@ -390,8 +408,10 @@ void runtest(BOOL dups) {
lt_insert(dups, 2, neg_infinite, 3, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, infinite, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, infinite, infinite, txn);
#endif
close_tree();
setup_tree(dups);
......@@ -401,8 +421,10 @@ void runtest(BOOL dups) {
lt_insert(dups, 2, neg_infinite, 5, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 6, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 6, infinite, txn);
#endif
close_tree();
setup_tree(dups);
......@@ -411,8 +433,10 @@ void runtest(BOOL dups) {
lt_insert(dups, 2, neg_infinite, 4, infinite);
rt = __toku_lt_ifexist_selfread(lt, txn); assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 5, infinite, txn);
#ifndef TOKU_RT_NOOVERLAPS
rt = lt->mainread; assert(rt);
lt_find(dups, rt, 1, 1, neg_infinite, 5, infinite, txn);
#endif
close_tree();
/* ************************************** */
......
......@@ -84,11 +84,11 @@ TLOG_BINS = ../log_nooverlap.o
LOG_BINS = ../log.o
%.lin: %.c ../rangetree.h test.h
cc -DDIR=\"dir.$<.lin\" $(CFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LINEAR_BINS)
cc -DDIR=\"dir.$<.lin\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINEAR_BINS)
%.tlog: %.c ../rangetree.h test.h
$(SETENV) cc -DDIR=\"dir.$<.log\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(TLOG_BINS)
cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(TLOG_BINS)
%.log: %.c ../rangetree.h test.h
$(SETENV) cc -DDIR=\"dir.$<.log\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LOG_BINS)
cc -DDIR=\"dir.$<.log\" $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LOG_BINS)
.PHONY: make_libs
......
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