From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: [PATCH 1/3] test: improve error handling in lib-error tests
Date: Wed, 6 Apr 2016 07:27:09 -0300 [thread overview]
Message-ID: <1459938431-28670-2-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1459938431-28670-1-git-send-email-david@tethera.net>
There is at least one bug fixed here (missing parameter to printf), even
if exiting via segfault is considered OK.
---
test/T560-lib-error.sh | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index 59a479c..49d3674 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -202,16 +202,20 @@ int main (int argc, char** argv)
notmuch_database_t *db;
notmuch_status_t stat;
char *path;
+ char *msg = NULL;
int fd;
- stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db);
+ stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg);
if (stat != NOTMUCH_STATUS_SUCCESS) {
- fprintf (stderr, "error opening database: %d\n", stat);
+ fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");
+ exit (1);
}
path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]);
fd = open(path,O_WRONLY|O_TRUNC);
- if (fd < 0)
- fprintf (stderr, "error opening %s\n");
+ if (fd < 0) {
+ fprintf (stderr, "error opening %s\n", argv[1]);
+ exit (1);
+ }
EOF
cat <<'EOF' > c_tail
if (stat) {
--
2.8.0.rc3
next prev parent reply other threads:[~2016-04-06 10:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 11:18 WIP: update for xapian 1.3.5 David Bremner
2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner
2016-04-06 10:27 ` Update test suite for glass backend David Bremner
2016-04-06 10:27 ` David Bremner [this message]
2016-04-06 10:27 ` [PATCH 2/3] test/atomicity: guard chert-only optimization David Bremner
2016-04-06 10:27 ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner
2016-04-07 13:57 ` Tomi Ollila
2016-04-05 11:18 ` [PATCH 2/2] WIP: update test suite for glass xapian backend David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459938431-28670-2-git-send-email-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).