X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT560-lib-error.sh;h=c99b17ed2fee141a43fb9faca006d3318f20d98e;hb=ee1f573204f87a0b2c20a193abf5c4d71e91f049;hp=67a5e8dfb6c6be9fc595fc286f2e5fc2152017dc;hpb=6a99505625785022d490207bdf6e3e29ed156c6a;p=notmuch diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 67a5e8df..c99b17ed 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -43,13 +43,13 @@ int main (int argc, char** argv) { notmuch_database_t *db; notmuch_status_t stat; - stat = notmuch_database_open ("/nonexistent/foo", 0, 0); + stat = notmuch_database_open ("./nonexistent/foo", 0, 0); } EOF cat <<'EOF' >EXPECTED == stdout == == stderr == -Error opening database at /nonexistent/foo/.notmuch: No such file or directory +Error opening database at ./nonexistent/foo/.notmuch: No such file or directory EOF test_expect_equal_file EXPECTED OUTPUT @@ -78,13 +78,13 @@ int main (int argc, char** argv) { notmuch_database_t *db; notmuch_status_t stat; - stat = notmuch_database_create ("/nonexistent/foo", &db); + stat = notmuch_database_create ("./nonexistent/foo", &db); } EOF cat <<'EOF' >EXPECTED == stdout == == stderr == -Error: Cannot create database at /nonexistent/foo: No such file or directory. +Error: Cannot create database at ./nonexistent/foo: No such file or directory. EOF test_expect_equal_file EXPECTED OUTPUT @@ -125,16 +125,17 @@ int main (int argc, char** argv) if (stat != NOTMUCH_STATUS_SUCCESS) { fprintf (stderr, "error opening database: %d\n", stat); } - stat = notmuch_database_add_message (db, "/nonexistent", NULL); - if (stat) - fputs (notmuch_database_status_string (db), stderr); - + stat = notmuch_database_add_message (db, "./nonexistent", NULL); + if (stat) { + char *status_string = notmuch_database_status_string (db); + if (status_string) fputs (status_string, stderr); + } } EOF cat <<'EOF' >EXPECTED == stdout == == stderr == -Error opening /nonexistent: No such file or directory +Error opening ./nonexistent: No such file or directory EOF test_expect_equal_file EXPECTED OUTPUT @@ -201,7 +202,7 @@ test_begin_subtest "Xapian exception finding message" cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} { notmuch_message_t *message = NULL; - stat = notmuch_database_find_message (db, "id:nonexistant", &message); + stat = notmuch_database_find_message (db, "id:nonexistent", &message); } EOF sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' < OUTPUT > OUTPUT.clean