unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 3/3] test: replace deprecated use of notmuch_database_create
Date: Sat, 21 May 2022 15:06:31 -0300	[thread overview]
Message-ID: <20220521180631.2419225-3-david@tethera.net> (raw)
In-Reply-To: <20220521180631.2419225-1-david@tethera.net>

Like notmuch_database_open, we need to conditionally print the error
message.
---
 test/T560-lib-error.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index 470537cc..80527afd 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -60,7 +60,10 @@ int main (int argc, char** argv)
 {
     notmuch_database_t *db;
     notmuch_status_t stat;
-    stat = notmuch_database_create ("./nonexistent/foo", &db);
+    char *msg = NULL;
+
+    stat = notmuch_database_create_with_config ("./nonexistent/foo", "", NULL, &db, &msg);
+    if (msg) fputs (msg, stderr);
 }
 EOF
 cat <<'EOF' >EXPECTED
@@ -99,7 +102,10 @@ test_C <<'EOF'
 int main (int argc, char** argv)
 {
     notmuch_status_t stat;
-    stat = notmuch_database_create (NULL, NULL);
+    char *msg;
+
+    stat = notmuch_database_create_with_config (NULL, "", NULL, NULL, &msg);
+    if (msg) fputs (msg, stderr);
 }
 EOF
 cat <<'EOF' >EXPECTED
@@ -117,7 +123,10 @@ int main (int argc, char** argv)
 {
     notmuch_database_t *db;
     notmuch_status_t stat;
-    stat = notmuch_database_create (argv[1], &db);
+    char *msg;
+
+    stat = notmuch_database_create_with_config (argv[1], "", NULL, &db, &msg);
+    if (msg) fputs (msg, stderr);
 }
 EOF
 cat <<'EOF' >EXPECTED
-- 
2.35.2

  parent reply	other threads:[~2022-05-21 18:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 18:06 [PATCH 1/3] test: replace deprecated use of notmuch_database_open_verbose David Bremner
2022-05-21 18:06 ` [PATCH 2/3] test: replace deprecated use of notmuch_database_open David Bremner
2022-05-21 18:06 ` David Bremner [this message]
2022-05-29 10:48 ` [PATCH 1/3] test: replace deprecated use of notmuch_database_open_verbose 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=20220521180631.2419225-3-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).