test: add regression test for n_d_get_config

Xapian exceptions seem to handled OK, at least for this case.
This commit is contained in:
David Bremner 2020-07-19 09:39:16 -03:00
parent dfab190a40
commit a5e13d5218

View file

@ -339,4 +339,20 @@ A Xapian exception occurred getting tags: Database has been closed.
EOF EOF
test_expect_equal_file EXPECTED OUTPUT test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "get config from closed database"
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
const char *result;
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_get_config (db, "foo", &result);
printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
== stdout ==
1
== stderr ==
Error: A Xapian exception occurred getting metadata: Database has been closed
EOF
test_expect_equal_file EXPECTED OUTPUT
test_done test_done