From 2000e79de41bc118dbfc29d30c51464e51a3d23a Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 8 Apr 2015 23:45:37 +0900 Subject: [PATCH] [PATCH 2/2] test: move nonexistent directory to something under notmuch's control. --- a0/a9e927fce0f3038e7dcb1f5b2e6948f1dffd87 | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 a0/a9e927fce0f3038e7dcb1f5b2e6948f1dffd87 diff --git a/a0/a9e927fce0f3038e7dcb1f5b2e6948f1dffd87 b/a0/a9e927fce0f3038e7dcb1f5b2e6948f1dffd87 new file mode 100644 index 000000000..63a48dc5b --- /dev/null +++ b/a0/a9e927fce0f3038e7dcb1f5b2e6948f1dffd87 @@ -0,0 +1,115 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id B33726DE1AFD + for ; Wed, 8 Apr 2015 07:47:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.399 +X-Spam-Level: +X-Spam-Status: No, score=0.399 tagged_above=-999 required=5 tests=[AWL=0.389, + T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Z4AcENyUAizz for ; + Wed, 8 Apr 2015 07:47:31 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id F10026DE1B74 + for ; Wed, 8 Apr 2015 07:47:30 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1YfrFD-0005G5-Oe; Wed, 08 Apr 2015 14:46:19 +0000 +Received: (nullmailer pid 18409 invoked by uid 1000); Wed, 08 Apr 2015 + 14:45:45 -0000 +From: David Bremner +To: Tomi Ollila , David Bremner , + notmuch@notmuchmail.org +Subject: [PATCH 2/2] test: move nonexistent directory to something under + notmuch's control. +Date: Wed, 8 Apr 2015 23:45:37 +0900 +Message-Id: <1428504337-18362-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1428504337-18362-1-git-send-email-david@tethera.net> +References: + <1428504337-18362-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 08 Apr 2015 14:47:32 -0000 + +Apparently some systems actually have a directory called /nonexist[ae]nt. +It's hard to fathom a good reason for that, but oh well. As long as we +don't create such a directory inside the notmuch source tree, the new +version should be more robust. +--- + test/T560-lib-error.sh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh +index 6947aa8..c99b17e 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,7 +125,7 @@ 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); ++ 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); +@@ -135,7 +135,7 @@ 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 + +-- +2.1.4 + -- 2.26.2