mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
test: regression test for n_directory_{get,set}_mtime
The mtime is cached, so closing the db is not a problem. Writing the mtime throws an exception, which is caught.
This commit is contained in:
parent
f4f5db0f1a
commit
e8ffbf84ff
1 changed files with 18 additions and 0 deletions
|
@ -109,4 +109,22 @@ EOF
|
|||
test_expect_equal_file EXPECTED OUTPUT
|
||||
restore_database
|
||||
|
||||
backup_database
|
||||
test_begin_subtest "get/set mtime of directory for a closed db"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
time_t stamp = notmuch_directory_get_mtime (dir);
|
||||
stat = notmuch_directory_set_mtime (dir, stamp);
|
||||
printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
== stderr ==
|
||||
A Xapian exception occurred setting directory mtime: Database has been closed.
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
restore_database
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue