test: add regression test for n_d_get_directory

At least this exception is already handled correctly.
This commit is contained in:
David Bremner 2020-07-17 07:38:09 -03:00
parent 959cb4b7a7
commit 1ca805a962

View file

@ -220,4 +220,21 @@ cat <<EOF > EXPECTED
EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "get directory for a closed db"
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_directory_t *dir;
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_get_directory (db, "/nonexistent", &dir);
printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
== stdout ==
1
== stderr ==
A Xapian exception occurred creating a directory: Database has been closed.
EOF
test_expect_equal_file EXPECTED OUTPUT
test_done