mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 03:48:10 +01:00
test: regression test for n_q_search_messages
Exception handling matches notmuch_query_search_threads, at least for this case.
This commit is contained in:
parent
25fc8662ed
commit
0a4c6cdeb1
1 changed files with 23 additions and 0 deletions
|
@ -162,4 +162,27 @@ Query string was: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net
|
|||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "search messages 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_messages_t *messages;
|
||||
|
||||
query = notmuch_query_create (db, str);
|
||||
EXPECT0(notmuch_database_close (db));
|
||||
stat = notmuch_query_search_messages (query, &messages);
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue