From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: David Bremner <david@tethera.net>
Subject: [PATCH 05/10] test: regression test for n_q_{set, get}_sort
Date: Wed, 22 Jul 2020 07:51:22 -0300 [thread overview]
Message-ID: <20200722105127.373054-6-david@tethera.net> (raw)
In-Reply-To: <20200722105127.373054-1-david@tethera.net>
We just want to make sure accessing the query owned by a closed db
does not cause a crash.
---
test/T564-lib-query.sh | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/test/T564-lib-query.sh b/test/T564-lib-query.sh
index ea176191..14e47cfb 100755
--- a/test/T564-lib-query.sh
+++ b/test/T564-lib-query.sh
@@ -99,4 +99,25 @@ SUCCESS
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "roundtrip sort 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_sort_t sort;
+
+ query = notmuch_query_create (db, str);
+ EXPECT0(notmuch_database_close (db));
+ notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
+ sort = notmuch_query_get_sort (query);
+ printf("%d\n", sort == NOTMUCH_SORT_UNSORTED);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done
--
2.27.0
next prev parent reply other threads:[~2020-07-22 10:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 10:51 batch 8, API cleanup for exception handling David Bremner
2020-07-22 10:51 ` [PATCH 01/10] test: move notmuch_message_* tests to their own file David Bremner
2020-07-22 10:51 ` [PATCH 02/10] test: add regression test for n_q_{create,_get_query_string} David Bremner
2020-07-22 10:51 ` [PATCH 03/10] test: regression test for notmuch_query_get_database David Bremner
2020-07-22 10:51 ` [PATCH 04/10] test: regression test for set_omit_excluded David Bremner
2020-07-22 10:51 ` David Bremner [this message]
2020-07-22 10:51 ` [PATCH 06/10] test: add regression test for n_q_add_tag_exclude David Bremner
2020-07-22 10:51 ` [PATCH 07/10] test: regression test for n_q_search_threads David Bremner
2020-07-22 10:51 ` [PATCH 08/10] test: regression test for n_q_search_messages David Bremner
2020-07-22 10:51 ` [PATCH 09/10] test: regression tests for n_q_count_{messages, threads} David Bremner
2020-07-22 10:51 ` [PATCH 10/10] test: regression test for notmuch_query_destroy David Bremner
2020-07-29 15:47 ` batch 8, API cleanup for exception handling David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200722105127.373054-6-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).