Commit 6801852a authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Add some more cases to test_db_get_put_flags.c. Addresess #180.

git-svn-id: file:///svn/tokudb@1292 c7de825b-a66e-492c-adef-691d508d4ae1
parent d8266b34
...@@ -95,6 +95,9 @@ endif ...@@ -95,6 +95,9 @@ endif
# For a few of the tests bdb is making valgrind unhappy. # For a few of the tests bdb is making valgrind unhappy.
FOO_NO_VGRIND = \ FOO_NO_VGRIND = \
db_already_exists \ db_already_exists \
db_curs2 \
db_dbt_appmalloc \
db_dbt_mem_behavior \
db_dup \ db_dup \
db_env_open_nocreate \ db_env_open_nocreate \
db_env_open_open_close \ db_env_open_open_close \
...@@ -105,6 +108,8 @@ FOO_NO_VGRIND = \ ...@@ -105,6 +108,8 @@ FOO_NO_VGRIND = \
dup_flags \ dup_flags \
dup_insert \ dup_insert \
dup_search \ dup_search \
kv_limits \
log4 \
rand_insert \ rand_insert \
reverse_compare_fun \ reverse_compare_fun \
# Comment to terminate list so the previous line can end with a slash # Comment to terminate list so the previous line can end with a slash
...@@ -119,9 +124,9 @@ $(patsubst %,test_%.bdbrun,$(NO_VGRIND)): VGRIND= ...@@ -119,9 +124,9 @@ $(patsubst %,test_%.bdbrun,$(NO_VGRIND)): VGRIND=
$(patsubst %,test_%.bdbrun,$(NO_VGRIND)): BDB_SUPPRESSIONS= $(patsubst %,test_%.bdbrun,$(NO_VGRIND)): BDB_SUPPRESSIONS=
%.bdb: %.c %.bdb: %.c
$(UNSETTOKUENV) cc -DDIR=\"dir.$<.bdb\" $(BDB_CPPFLAGS) -DUSE_BDB $(CFLAGS) $< $(BDB_LDFLAGS) -ldb -o $@ $(UNSETTOKUENV) cc -DDIR=\"dir.$<.bdb\" $(BDB_CPPFLAGS) -DUSE_BDB -DIS_TDB=0 $(CFLAGS) $< $(BDB_LDFLAGS) -ldb -o $@
%.tdb: %.c %.tdb: %.c
$(SETTOKUENV) cc -DDIR=\"dir.$<.tdb\" -DUSE_TDB $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LOADLIBES) $< -o $@ $(SETTOKUENV) cc -DDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1 $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LOADLIBES) $< -o $@
.PHONY: %.recover .PHONY: %.recover
all.recover: test_log2.recover test_log3.recover test_log4.recover all.recover: test_log2.recover test_log3.recover test_log4.recover
......
...@@ -124,8 +124,11 @@ void cinsert_test(TEST tests[4]) { ...@@ -124,8 +124,11 @@ void cinsert_test(TEST tests[4]) {
r = dbc->c_close(dbc); CKERR(r); r = dbc->c_close(dbc); CKERR(r);
} }
#ifndef USE_TDB #ifdef USE_TDB
#define EINVAL_FOR_TDB_OK_FOR_BDB EINVAL
#else
#define DB_YESOVERWRITE 0 //This is just so test numbers stay the same. #define DB_YESOVERWRITE 0 //This is just so test numbers stay the same.
#define EINVAL_FOR_TDB_OK_FOR_BDB 0
#endif #endif
...@@ -136,7 +139,8 @@ PUT_TEST put_tests[] = { ...@@ -136,7 +139,8 @@ PUT_TEST put_tests[] = {
{1, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, {1, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0},
{0, 0, DB_NOOVERWRITE, 0, 0, 0}, {0, 0, DB_NOOVERWRITE, 0, 0, 0},
{0, DB_DUP|DB_DUPSORT, DB_NOOVERWRITE, 0, 0, 0}, {0, DB_DUP|DB_DUPSORT, DB_NOOVERWRITE, 0, 0, 0},
{0, 0, 0, 0, 0, 0}, //r_expect must change to EINVAL when/if we no longer accept 0 as flags for put {0, 0, 0, 0, 0, 0},
{0, DB_DUP|DB_DUPSORT, 0, EINVAL_FOR_TDB_OK_FOR_BDB, 0, 0}, //r_expect must be EINVAL for TokuDB since DB_DUPSORT doesn't accept put with flags==0
{1, DB_DUP|DB_DUPSORT, 0, EINVAL, 0, 0}, {1, DB_DUP|DB_DUPSORT, 0, EINVAL, 0, 0},
}; };
const int num_put = sizeof(put_tests) / sizeof(put_tests[0]); const int num_put = sizeof(put_tests) / sizeof(put_tests[0]);
...@@ -160,12 +164,19 @@ CPUT_TEST cput_tests[] = { ...@@ -160,12 +164,19 @@ CPUT_TEST cput_tests[] = {
const int num_cput = sizeof(cput_tests) / sizeof(cput_tests[0]); const int num_cput = sizeof(cput_tests) / sizeof(cput_tests[0]);
GET_TEST get_tests[] = { GET_TEST get_tests[] = {
{{0, 0, 0, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, 0, 0, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, 0, 0, 0, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1},
{{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0}, {{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0}, {{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1}, {{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1},
{{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0}, {{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, DB_DUP|DB_DUPSORT, 0, EINVAL_FOR_TDB_OK_FOR_BDB, 0, 0}, DB_GET_BOTH, IS_TDB ? DB_NOTFOUND : 0, 0, 0},
{{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, 0, 0, 0},
{{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1}, {{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1},
{{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_RMW, EINVAL, 0, 0}, {{0, 0, DB_YESOVERWRITE, 0, 0, 0}, DB_RMW, EINVAL, 0, 0},
{{0, DB_DUP|DB_DUPSORT, 0, EINVAL_FOR_TDB_OK_FOR_BDB, 0, 0}, DB_GET_BOTH, DB_NOTFOUND, 0, 1},
{{0, 0, 0, 0, 0, 0}, DB_RMW, EINVAL, 0, 0},
{{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_RMW, EINVAL, 0, 0}, {{0, DB_DUP|DB_DUPSORT, DB_YESOVERWRITE, 0, 0, 0}, DB_RMW, EINVAL, 0, 0},
}; };
const int num_get = sizeof(get_tests) / sizeof(get_tests[0]); const int num_get = sizeof(get_tests) / sizeof(get_tests[0]);
......
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