aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-22 07:51:24 -0300
committerDavid Bremner <david@tethera.net>2020-07-29 12:20:14 -0300
commit25fc8662edf94a29314bfc01f2a335eb47c142c0 (patch)
treec881326e97368e376480660559a79a76642e5997 /test
parent4130b4e514e9ad16b420db2736f9cbb79d829fa9 (diff)
test: regression test for n_q_search_threads
At least this exception is caught.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T564-lib-query.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/T564-lib-query.sh b/test/T564-lib-query.sh
index a2f5d731..97729f9a 100755
--- a/test/T564-lib-query.sh
+++ b/test/T564-lib-query.sh
@@ -139,4 +139,27 @@ cat <<EOF > EXPECTED
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "search threads on 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";
+ notmuch_threads_t *threads;
+
+ query = notmuch_query_create (db, str);
+ EXPECT0(notmuch_database_close (db));
+ stat = notmuch_query_search_threads (query, &threads);
+
+ printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+A Xapian exception occurred performing query: Database has been closed
+Query string was: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done