diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh index fe5555ec..83499d4a 100755 --- a/test/T562-lib-database.sh +++ b/test/T562-lib-database.sh @@ -100,4 +100,35 @@ cat < EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "destroy a closed db" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + unsigned int version; + EXPECT0(notmuch_database_close (db)); + stat = notmuch_database_destroy (db); + printf ("%d\n", stat); + } +EOF +cat < EXPECTED +== stdout == +0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "destroy an open db" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + unsigned int version; + stat = notmuch_database_destroy (db); + printf ("%d\n", stat); + } +EOF +cat < EXPECTED +== stdout == +0 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done