mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
test: add known broken test for n_d_needs_upgrade
It's a bit arbitrary which value to return for errors, but the same argument as for read only databases applies for errors.
This commit is contained in:
parent
37dc6045e4
commit
cf90431cbf
1 changed files with 20 additions and 0 deletions
|
@ -131,4 +131,24 @@ 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);
|
||||
stat = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
== stderr ==
|
||||
A Xapian exception occurred at lib/database.cc:XXX: Database has been closed
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue