[PATCH 10/13] test: regression test for n_d_get_config_list on closed db.

Subject: [PATCH 10/13] test: regression test for n_d_get_config_list on closed db.

Date: Sun, 26 Jul 2020 08:59:28 -0300

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


Exception is caught.
---
 test/T590-libconfig.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index 46f3a76d..602fad0b 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -61,6 +61,21 @@ valid = 0
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest "notmuch_database_get_config_list: closed db"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+{
+   notmuch_config_list_t *list;
+   EXPECT0(notmuch_database_close (db));
+   stat = notmuch_database_get_config_list (db, "nonexistent", &list);
+   printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+}
+EOF
+cat <<'EOF' >EXPECTED
+== stdout ==
+1
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "notmuch_database_get_config_list: all pairs"
 cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
-- 
2.27.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: