From: David Bremner Date: Wed, 22 Jul 2020 10:51:24 +0000 (-0300) Subject: test: regression test for n_q_search_threads X-Git-Tag: 0.31_rc0~77 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;ds=inline;h=25fc8662edf94a29314bfc01f2a335eb47c142c0;p=notmuch test: regression test for n_q_search_threads At least this exception is caught. --- 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 < 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 < 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