X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT560-lib-error.sh;h=5b5ad7651b074ef34e77ac28522e3432cba81352;hp=36c4c1cec9c81368d945f09af35b854a2e8a2ba1;hb=a2b90dc084c0224e56c1e63773048545788c7ad4;hpb=2d04ed263121d970cd24a8c26ac924425a7ae3d2 diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 36c4c1ce..5b5ad765 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -533,4 +533,69 @@ cat < EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Handle read maildir flag with closed database" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_bool_t is_set = -1; + is_set = notmuch_message_has_maildir_flag (message, 'S'); + printf("%d\n%d\n", message != NULL, is_set == FALSE || is_set == TRUE); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle checking maildir flag with closed db (new API)" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + notmuch_bool_t out; + status = notmuch_message_has_maildir_flag_st (message, 'S', &out); + printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle converting maildir flags to tags with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + status = notmuch_message_maildir_flags_to_tags (message); + printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle removing all tags with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + status = notmuch_message_remove_all_tags (message); + printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done