[PATCH 4/8] lib: add regresion test for n_d_get_all_tags

Subject: [PATCH 4/8] lib: add regresion test for n_d_get_all_tags

Date: Sun, 19 Jul 2020 10:18:53 -0300

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


Existing error handling seems adequate, if not ideal.
---
 test/T562-lib-database.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index fea77f78..bb454ea5 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -315,4 +315,20 @@ A Xapian exception occurred finding/creating a directory: Database has been clos
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest "Handle getting tags from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+    {
+        notmuch_tags_t *result;
+        EXPECT0(notmuch_database_close (db));
+        result = notmuch_database_get_all_tags (db);
+        printf("%d\n",  result == NULL);
+    }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
-- 
2.27.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: