aboutsummaryrefslogtreecommitdiff
path: root/test/T562-lib-database.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-19 09:39:16 -0300
committerDavid Bremner <david@tethera.net>2020-07-22 19:52:55 -0300
commita5e13d52187f9863269a88cc83042c50f1838d47 (patch)
tree12e6adaf7bce1f8bdb7d2ed2c501a3c4e7676275 /test/T562-lib-database.sh
parentdfab190a4089b3d04addd0989053461d43c2bdeb (diff)
test: add regression test for n_d_get_config
Xapian exceptions seem to handled OK, at least for this case.
Diffstat (limited to 'test/T562-lib-database.sh')
-rwxr-xr-xtest/T562-lib-database.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index 60e944fc..09988a45 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -339,4 +339,20 @@ A Xapian exception occurred getting tags: Database has been closed.
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "get config from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ const char *result;
+ EXPECT0(notmuch_database_close (db));
+ stat = notmuch_database_get_config (db, "foo", &result);
+ printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+Error: A Xapian exception occurred getting metadata: Database has been closed
+EOF
+test_expect_equal_file EXPECTED OUTPUT
test_done