diff --git a/cxx/tests/Makefile b/cxx/tests/Makefile index 722a5f737cf..64fc65ede8e 100644 --- a/cxx/tests/Makefile +++ b/cxx/tests/Makefile @@ -22,10 +22,15 @@ $(DBCXX): clean: rm -rf $(TARGETS) *.gcno *.gcda *.gcov *.db -check: $(TARGETS) +check: $(TARGETS) \ + check_db_create_1 check_db_create_2 check_db_create_3 check_db_create_4 $(VGRIND) ./test1 $(VGRIND) ./test1e rm -f foo.db + $(VGRIND) ./db_create -s main foo.db + rm -f foo.db + $(VGRIND) ./db_create -D -S -s main foo.db + rm -f foo.db $(VGRIND) ./db_create foo.db a b c d $(VGRIND) ./db_dump foo.db > foo.out (echo " 61";echo " 62";echo " 63";echo " 64")>foo.expectout @@ -41,3 +46,12 @@ check: $(TARGETS) $(VGRIND) ./test_error_stream $(VGRIND) ./test_reverse_compare_fun $(VGRIND) ./test_db_delete + +check_db_create_1: + $(VGRIND) ./db_create; let exitcode=$$?; if [ $$exitcode -ne 0 ] ; then exit 0; else exit 1; fi +check_db_create_2: + $(VGRIND) ./db_create -h; let exitcode=$$?; if [ $$exitcode -ne 0 ] ; then exit 0; else exit 1; fi +check_db_create_3: + $(VGRIND) ./db_create --help; let exitcode=$$?; if [ $$exitcode -ne 0 ] ; then exit 0; else exit 1; fi +check_db_create_4: + $(VGRIND) ./db_create -s; let exitcode=$$?; if [ $$exitcode -ne 0 ] ; then exit 0; else exit 1; fi diff --git a/cxx/tests/db_create.cpp b/cxx/tests/db_create.cpp index a2831522210..7bb760d8ab3 100644 --- a/cxx/tests/db_create.cpp +++ b/cxx/tests/db_create.cpp @@ -1,6 +1,8 @@ #include #include +#define USE_ENV 1 + int dbcreate(char *dbfile, char *dbname, int dbflags, int argc, char *argv[]) { int r; #if USE_ENV @@ -26,11 +28,13 @@ int dbcreate(char *dbfile, char *dbname, int dbflags, int argc, char *argv[]) { } r = db->close(0); assert(r == 0); + delete db; +#if USE_ENV if (env) { r = env->close(0); assert(r == 0); delete env; } - delete db; +#endif return 0; }