test: regression test for n_d_upgrade

The logic is that if it's acceptable to return SUCCESS for read only
database, it's acceptable for a closed one.
This commit is contained in:
David Bremner 2020-07-16 19:34:02 -03:00
parent f25fc8e211
commit 3f121d636e

View file

@ -150,4 +150,21 @@ A Xapian exception occurred at lib/database.cc:XXX: Database has been closed
EOF EOF
test_expect_equal_file EXPECTED OUTPUT test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "upgrade a closed db"
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_bool_t ret;
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_upgrade (db, NULL, NULL);
printf ("%d\n", ret == NOTMUCH_STATUS_SUCCESS);
}
EOF
cat <<EOF > EXPECTED
== stdout ==
1
== stderr ==
EOF
test_expect_equal_file EXPECTED OUTPUT
test_done test_done