Commit 556aa0fd authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

lock tree tests had to be fixed up for -combine. Addresses #793.

git-svn-id: file:///svn/tokudb@3855 c7de825b-a66e-492c-adef-691d508d4ae1
parent 83b7ff86
...@@ -99,7 +99,7 @@ endif ...@@ -99,7 +99,7 @@ endif
%.tlogrun: %.tlog %.tlogrun: %.tlog
$(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE) $(MAYBEATSIGN) $(VGRIND) ./$< $(VERBVERBOSE)
NEWBRT_BINS = ../../../newbrt/toku_assert.o NEWBRT_BINS = ../../../newbrt/newbrt.o
RT_LINEAR_BINS = ../../range_tree/linear.o RT_LINEAR_BINS = ../../range_tree/linear.o
RT_TLINEAR_BINS = ../../range_tree/linear.o RT_TLINEAR_BINS = ../../range_tree/linear.o
...@@ -118,13 +118,13 @@ foo: ...@@ -118,13 +118,13 @@ foo:
echo ../locktree.h test.h $(LT_LINEAR) echo ../locktree.h test.h $(LT_LINEAR)
%.lin: %.c ../locktree.h test.h $(LT_LINEAR) %.lin: %.c ../locktree.h test.h $(LT_LINEAR)
cc -DDIR=\"dir.$<.lin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR) $(NEWBRT_BINS) cc -DDIR=\"dir.$<.lin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LINEAR) $(NEWBRT_BINS) -lz
%.tlin: %.c ../locktree.h test.h $(LT_TLINEAR) %.tlin: %.c ../locktree.h test.h $(LT_TLINEAR)
cc -DDIR=\"dir.$<.tlin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLINEAR) $(NEWBRT_BINS) -DTOKU_RT_NOOVERLAPS cc -DDIR=\"dir.$<.tlin\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLINEAR) $(NEWBRT_BINS) -DTOKU_RT_NOOVERLAPS -lz
%.tlog: %.c ../locktree.h test.h $(LT_TLOG) %.tlog: %.c ../locktree.h test.h $(LT_TLOG)
cc -DDIR=\"dir.$<.tlog\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLOG) $(NEWBRT_BINS) -DTOKU_RT_NOOVERLAPS cc -DDIR=\"dir.$<.tlog\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_TLOG) $(NEWBRT_BINS) -DTOKU_RT_NOOVERLAPS -lz
%.log: %.c ../locktree.h test.h $(LT_LOG) %.log: %.c ../locktree.h test.h $(LT_LOG)
cc -DDIR=\"dir.$<.log\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LOG) $(NEWBRT_BINS) cc -DDIR=\"dir.$<.log\" $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LT_LOG) $(NEWBRT_BINS) -lz
clean: clean:
rm -f $(ALL_TESTS) *.o *.gcno *.gcda *.gcov rm -f $(ALL_TESTS) *.o *.gcno *.gcda *.gcov
......
...@@ -12,30 +12,11 @@ int verbose=0; ...@@ -12,30 +12,11 @@ int verbose=0;
#include <lth.h> #include <lth.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <memory.h>
#include <key.h>
BOOL want_panic = FALSE;
int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) { BOOL want_panic = FALSE;
int comparelen = key1len<key2len ? key1len : key2len;
const unsigned char *k1;
const unsigned char *k2;
for (k1=key1, k2=key2;
comparelen>4;
k1+=4, k2+=4, comparelen-=4) {
{ int v1=k1[0], v2=k2[0]; if (v1!=v2) return v1-v2; }
{ int v1=k1[1], v2=k2[1]; if (v1!=v2) return v1-v2; }
{ int v1=k1[2], v2=k2[2]; if (v1!=v2) return v1-v2; }
{ int v1=k1[3], v2=k2[3]; if (v1!=v2) return v1-v2; }
}
for (;
comparelen>0;
k1++, k2++, comparelen--) {
if (*k1 != *k2) {
return (int)*k1-(int)*k2;
}
}
return key1len-key2len;
}
int intcmp(DB *db __attribute__((__unused__)), const DBT* a, const DBT* b) { int intcmp(DB *db __attribute__((__unused__)), const DBT* a, const DBT* b) {
int x = *(int*)a->data; int x = *(int*)a->data;
...@@ -103,18 +84,6 @@ static inline uint32_t myrandom (void) { ...@@ -103,18 +84,6 @@ static inline uint32_t myrandom (void) {
} }
void* toku_malloc(size_t size) {
return malloc(size);
}
void toku_free(void* p) {
free(p);
}
void* toku_realloc(void *ptr, size_t size) {
return realloc(ptr, size);
}
DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) { DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) {
memset(dbt, 0, sizeof *dbt); memset(dbt, 0, sizeof *dbt);
dbt->data = data; dbt->data = data;
...@@ -148,10 +117,3 @@ void* fail_malloc(size_t size) { ...@@ -148,10 +117,3 @@ void* fail_malloc(size_t size) {
} }
return malloc(size); return malloc(size);
} }
char *toku_strdup (const char *s) {
size_t len = strlen(s) + 1;
void * r = toku_malloc(len);
memcpy(r, s, len);
return r;
}
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