aboutsummaryrefslogtreecommitdiff
path: root/test/T562-lib-database.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-05-25 07:51:16 -0300
committerDavid Bremner <david@tethera.net>2022-06-25 16:06:18 -0300
commit3f27cce71f9f154cb0c2134c32d41c31eb62a239 (patch)
tree885c88706efdd7a771944287e4c2c27cfe737e11 /test/T562-lib-database.sh
parent7e654e2a456c552052e9e50b83da73b4d31d8f2b (diff)
lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable
In order for a database to actually be writeable, it must be the case that it is open, not just the correct type of Xapian object. By explicitely checking, we are able to provide better error reporting, in particular for the previously broken test in T566-lib-message.
Diffstat (limited to 'test/T562-lib-database.sh')
-rwxr-xr-xtest/T562-lib-database.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index 64233c37..fedfc9ed 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -243,14 +243,14 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
const char *path = talloc_asprintf(db, "%s/01:2,", argv[1]);
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_index_file (db, path, NULL, &msg);
- printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf ("%d\n", stat == NOTMUCH_STATUS_CLOSED_DATABASE);
}
EOF
cat <<EOF > EXPECTED
== stdout ==
1
== stderr ==
-A Xapian exception occurred finding message: Database has been closed.
+Cannot write to a closed database.
EOF
test_expect_equal_file EXPECTED OUTPUT
@@ -358,14 +358,14 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_set_config (db, "foo", "bar");
- printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n", stat == NOTMUCH_STATUS_CLOSED_DATABASE);
}
EOF
cat <<EOF > EXPECTED
== stdout ==
1
== stderr ==
-Error: A Xapian exception occurred setting metadata: Database has been closed
+Cannot write to a closed database.
EOF
test_expect_equal_file EXPECTED OUTPUT