test_begin_subtest "Xapian exception: read only files"
-chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB
+chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )
-chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB
+chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
test_expect_equal "$output" "A Xapian exception occurred opening database"
test_done
backup_database
test_begin_subtest "error message for database open"
-dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.DB" count=3
+dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}" count=3
notmuch count '*' 2>OUTPUT 1>/dev/null
output=$(sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' OUTPUT)
test_expect_equal "${output}" "A Xapian exception occurred opening database"
set breakpoint pending on
break count_files
commands
-shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.DB
+shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}
continue
end
run
test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'
test_begin_subtest "Xapian exception: read only files"
-chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB
+chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )
-chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB
+chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
test_expect_equal "$output" "A Xapian exception occurred opening database"
test_done
mkdir -p ${PWD}/fakedb/.notmuch
( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
$TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \
- 2>&1 | notmuch_dir_sanitize | sed "s,\`,\',g") > OUTPUT
+ 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g") > OUTPUT
cat <<EOF > EXPECTED
A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian'
-caught No chert database found at path 'CWD/nonexistent'
+caught No backend database found at path 'CWD/nonexistent'
EOF
test_expect_equal_file EXPECTED OUTPUT
EOF
test_expect_equal_file EXPECTED OUTPUT
-cat <<'EOF' > c_head
+cat <<EOF > c_head
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");
exit (1);
}
- path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]);
+ path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]);
fd = open(path,O_WRONLY|O_TRUNC);
if (fd < 0) {
fprintf (stderr, "error opening %s\n", argv[1]);