X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT568-lib-thread.sh;h=ac13d98671289c0c2a55e13ec51bfbf02fb57126;hb=ee26cae09345df9534b2fe36f10ff8aed57f2422;hp=3eb28f3b5be668763189461ac924d85f164a39e2;hpb=43406e7d4c081583878ede8f2b5a55f937fa4edd;p=notmuch diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh index 3eb28f3b..ac13d986 100755 --- a/test/T568-lib-thread.sh +++ b/test/T568-lib-thread.sh @@ -262,5 +262,73 @@ cat < 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 < EXPECTED +== stdout == +inbox +signed +unread +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "collect tags with closed database" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_messages_t *messages = notmuch_thread_get_messages (thread); + + notmuch_tags_t *tags = notmuch_messages_collect_tags (messages); + + 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); + } + notmuch_tags_destroy (tags); + notmuch_messages_destroy (messages); + + printf("SUCCESS\n"); + } +EOF +cat < EXPECTED +== stdout == +inbox +signed +unread +SUCCESS +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "destroy thread with closed database" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + time_t stamp; + notmuch_thread_destroy (thread); + printf("SUCCESS\n"); + } +EOF +cat < EXPECTED +== stdout == +SUCCESS +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT test_done