Commit c0d629c7 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Make test_db_assoc3 work with -v. Make it run with vgrind. Fixes #163.

git-svn-id: file:///svn/tokudb@1328 c7de825b-a66e-492c-adef-691d508d4ae1
parent 161e70ed
...@@ -61,7 +61,7 @@ foo: ...@@ -61,7 +61,7 @@ foo:
echo ALL_TESTS: $(ALL_TESTS) echo ALL_TESTS: $(ALL_TESTS)
.PHONY: check check.bdb check.tdb .PHONY: check check.bdb check.tdb
check: check.bdb check.tdb all.recover check: check.bdb check.tdb all.recover test_db_assoc3.tdbrun_wasbad
@ echo ok @ echo ok
check.bdb: $(RUN_BDB_TESTS) check.bdb: $(RUN_BDB_TESTS)
check.tdb: $(RUN_TDB_TESTS) check.tdb: $(RUN_TDB_TESTS)
...@@ -152,8 +152,8 @@ test_db_curs4.bdb: trace.h ...@@ -152,8 +152,8 @@ test_db_curs4.bdb: trace.h
test_db_assoc3.tdb test_db_assoc3.bdb: test.h test_db_assoc3.tdb test_db_assoc3.bdb: test.h
# This one fails in both BDB and TokuDB, in the same way. It must be a program error. # This one failed in both BDB and TokuDB, in the same way. It was a program error. Now it works
test_db_assoc3.tdbrun.bad: test_db_assoc3.tdb test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdb
./test_db_assoc3.tdb --seed=1 --count=200 ./test_db_assoc3.tdb --seed=1 --count=200
./test_db_assoc3.tdb --seed=1 --count=200 --more ./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more ./test_db_assoc3.tdb --seed=1 --count=200 --more
...@@ -163,9 +163,9 @@ test_db_assoc3.tdbrun.bad: test_db_assoc3.tdb ...@@ -163,9 +163,9 @@ test_db_assoc3.tdbrun.bad: test_db_assoc3.tdb
./test_db_assoc3.tdb --seed=1 --count=200 --more ./test_db_assoc3.tdb --seed=1 --count=200 --more
test_db_assoc3.tdbrun: test_db_assoc3.tdb test_db_assoc3.tdbrun: test_db_assoc3.tdb
./test_db_assoc3.tdb --seed=2 --count=100000 $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 $(VERBVERBOSE)
./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VERBVERBOSE)
test_db_assoc3.bdbrun: test_db_assoc3.bdb test_db_assoc3.bdbrun: test_db_assoc3.bdb
./test_db_assoc3.bdb --seed=2 --count=100000 $(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 $(VERBVERBOSE)
./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VERBVERBOSE)
...@@ -487,6 +487,7 @@ int main (int argc, const char *argv[]) { ...@@ -487,6 +487,7 @@ int main (int argc, const char *argv[]) {
const char *progname=argv[0]; const char *progname=argv[0];
int useseed; int useseed;
int activity_count = 100000; int activity_count = 100000;
int verbose=0;
{ {
struct timeval tv; struct timeval tv;
...@@ -510,6 +511,8 @@ int main (int argc, const char *argv[]) { ...@@ -510,6 +511,8 @@ int main (int argc, const char *argv[]) {
mode = MODE_DB_CREATE; mode = MODE_DB_CREATE;
} else if (strcmp(argv[0], "--more")==0) { } else if (strcmp(argv[0], "--more")==0) {
mode = MODE_MORE; mode = MODE_MORE;
} else if (strcmp(argv[0], "-v")==0) {
verbose=1;
} else if (maybe_parse_intarg(progname, argv[0], "--seed=", &useseed) } else if (maybe_parse_intarg(progname, argv[0], "--seed=", &useseed)
|| maybe_parse_intarg(progname, argv[0], "--count=", &activity_count)) { || maybe_parse_intarg(progname, argv[0], "--count=", &activity_count)) {
/* nothing */ /* nothing */
...@@ -519,7 +522,7 @@ int main (int argc, const char *argv[]) { ...@@ -519,7 +522,7 @@ int main (int argc, const char *argv[]) {
argc--; argv++; argc--; argv++;
} }
printf("seed=%d\n", useseed); if (verbose) printf("seed=%d\n", useseed);
mysrandom(useseed); mysrandom(useseed);
switch (mode) { switch (mode) {
...@@ -540,7 +543,7 @@ int main (int argc, const char *argv[]) { ...@@ -540,7 +543,7 @@ int main (int argc, const char *argv[]) {
{ {
int i; int i;
cursor_load = 8*(1+2*count_all_items/activity_count); cursor_load = 8*(1+2*count_all_items/activity_count);
printf("%s:%d count=%d cursor_load=%d\n", __FILE__, __LINE__, count_all_items, cursor_load); if (verbose) printf("%s:%d count=%d cursor_load=%d\n", __FILE__, __LINE__, count_all_items, cursor_load);
for (i=0; i<activity_count; i++) for (i=0; i<activity_count; i++)
activity(); activity();
} }
......
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