It's a bit arbitrary which value to return for errors, but the same argument as for read only databases applies for errors. --- test/T562-lib-database.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh index db7a34f3..0af7587a 100755 --- a/test/T562-lib-database.sh +++ b/test/T562-lib-database.sh @@ -129,4 +129,22 @@ cat <<EOF > EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "check a closed db for upgrade" +test_subtest_known_broken +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_bool_t ret; + + EXPECT0(notmuch_database_close (db)); + ret = notmuch_database_needs_upgrade (db); + printf ("%d\n", ret == FALSE); + } +EOF +cat <<EOF > EXPECTED +== stdout == +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done -- 2.27.0 _______________________________________________ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-leave@notmuchmail.org