aboutsummaryrefslogtreecommitdiff
path: root/test/T564-lib-query.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-22 07:51:27 -0300
committerDavid Bremner <david@tethera.net>2020-07-29 12:20:41 -0300
commit46468baa5a877b16bf0bb769fc00dd1c2c4b70b0 (patch)
tree81e37e73c4eadd8a5ad881f52d16cb7b2f42f719 /test/T564-lib-query.sh
parent451c0ce3fce6141ee658153a074b78a2b0e24955 (diff)
test: regression test for notmuch_query_destroy
As with other void API entries, not crashing counts as success.
Diffstat (limited to 'test/T564-lib-query.sh')
-rwxr-xr-xtest/T564-lib-query.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/T564-lib-query.sh b/test/T564-lib-query.sh
index 745d28a4..50b0a88e 100755
--- a/test/T564-lib-query.sh
+++ b/test/T564-lib-query.sh
@@ -231,4 +231,24 @@ Query string was: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "destroy query with closed db"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ notmuch_query_t *query;
+ const char *str = "id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net";
+
+ query = notmuch_query_create (db, str);
+ EXPECT0(notmuch_database_close (db));
+ notmuch_query_destroy (query);
+
+ printf("SUCCESS\n");
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+SUCCESS
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done