aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-24 08:14:05 -0300
committerDavid Bremner <david@tethera.net>2020-07-31 07:41:00 -0300
commit864f422f149c709e5701ba194a32931d9f216e4c (patch)
treeac6c852fb8fb793fde2831a9e4283a41962ec95b
parent43406e7d4c081583878ede8f2b5a55f937fa4edd (diff)
test: regression test for n_thread_get_tags
Code is taken from the API docs, with the twist that the underlying database is closed. Not crashing is the main point.
-rwxr-xr-xtest/T568-lib-thread.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh
index 3eb28f3b..82e4ecb8 100755
--- a/test/T568-lib-thread.sh
+++ b/test/T568-lib-thread.sh
@@ -262,5 +262,28 @@ cat <<EOF > EXPECTED
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "iterate tags from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ notmuch_tags_t *tags;
+ const char *tag;
+ for (tags = notmuch_thread_get_tags (thread);
+ notmuch_tags_valid (tags);
+ notmuch_tags_move_to_next (tags))
+ {
+ tag = notmuch_tags_get (tags);
+ printf ("%s\n", tag);
+ }
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+inbox
+signed
+unread
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done