X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT560-lib-error.sh;h=fda1f1708dc4de54b4ee22bcba63adc3820522ab;hp=2aee132b5d4b940278029abb51aad642ebe55a40;hb=765ca7bc08f83a3c0f9ebffe58dab03634e45f37;hpb=e32f66d0e30b6bd0ddb225f06785f7689349fcb9 diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 2aee132b..fda1f170 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -582,4 +582,99 @@ cat < EXPECTED 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_begin_subtest "Handle freezing message with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + status = notmuch_message_freeze (message); + printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_SUCCESS); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle thawing message with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + status = notmuch_message_thaw (message); + printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle destroying message with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_message_destroy (message); + printf("%d\n%d\n", message != NULL, 1); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle retrieving closed db from message" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_database_t *db2; + db2 = notmuch_message_get_database (message); + printf("%d\n%d\n", message != NULL, db == db2); + } +EOF +cat < EXPECTED +== stdout == +1 +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Handle reindexing message with closed db" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_status_t status; + status = notmuch_message_reindex (message, NULL); + 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