From 24cf4381b8e29e62c3a636082414df2d91ec0f22 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 19 Jul 2020 10:11:13 -0300 Subject: [PATCH] test: add known broken test for n_d_get_default_indexopts Xapian exceptions are swallowed and turned into default return value. --- test/T562-lib-database.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh index f767fddf..32fda72e 100755 --- a/test/T562-lib-database.sh +++ b/test/T562-lib-database.sh @@ -372,4 +372,21 @@ Error: A Xapian exception occurred setting metadata: Database has been closed EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "get indexopts from closed database" +test_subtest_known_broken +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_indexopts_t *result; + EXPECT0(notmuch_database_close (db)); + result = notmuch_database_get_default_indexopts (db); + printf("%d\n", result == NULL); + } +EOF +cat < EXPECTED +== stdout == +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done -- 2.43.0