From: David Bremner Date: Thu, 9 Jul 2020 00:17:06 +0000 (-0300) Subject: test: regression test for destroying message with closed db X-Git-Tag: 0.31_rc0~120 X-Git-Url: https://git.cworth.org/git?p=notmuch;a=commitdiff_plain;h=1578e2af6a412a72346d5264d2d6707972a95b33 test: regression test for destroying message with closed db This should be fine because the message belongs to the database (talloc context wise). --- diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 1ee9bd06..492c1fb5 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -630,4 +630,19 @@ cat < EXPECTED 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_done