[PATCH 02/18] test: convert random-corpus to use n_d_open_with_config

Subject: [PATCH 02/18] test: convert random-corpus to use n_d_open_with_config

Date: Sat, 20 Feb 2021 12:44:32 -0400

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


Remove one more usage of notmuch_config_get_database_path
---
 test/random-corpus.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/test/random-corpus.c b/test/random-corpus.c
index ff413252..67e106e0 100644
--- a/test/random-corpus.c
+++ b/test/random-corpus.c
@@ -141,7 +141,6 @@ main (int argc, char **argv)
     void *ctx = talloc_new (NULL);
 
     const char *config_path = NULL;
-    notmuch_config_t *config;
     notmuch_database_t *notmuch;
 
     int num_messages = 500;
@@ -179,12 +178,12 @@ main (int argc, char **argv)
 	exit (1);
     }
 
-    config = notmuch_config_open (ctx, config_path, false);
-    if (config == NULL)
-	return 1;
-
-    if (notmuch_database_open (notmuch_config_get_database_path (config),
-			       NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch))
+    if (notmuch_database_open_with_config (NULL,
+					   NOTMUCH_DATABASE_MODE_READ_WRITE,
+					   config_path,
+					   NULL,
+					   &notmuch,
+					   NULL))
 	return 1;
 
     srandom (seed);
-- 
2.30.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: