From a5e13d52187f9863269a88cc83042c50f1838d47 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 19 Jul 2020 09:39:16 -0300 Subject: [PATCH] test: add regression test for n_d_get_config Xapian exceptions seem to handled OK, at least for this case. --- test/T562-lib-database.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh index 60e944fc..09988a45 100755 --- a/test/T562-lib-database.sh +++ b/test/T562-lib-database.sh @@ -339,4 +339,20 @@ A Xapian exception occurred getting tags: Database has been closed. EOF 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 < EXPECTED +== stdout == +1 +== stderr == +Error: A Xapian exception occurred getting metadata: Database has been closed +EOF +test_expect_equal_file EXPECTED OUTPUT test_done