]> git.notmuchmail.org Git - notmuch/blobdiff - test/random-corpus.c
test: convert random-corpus to use n_d_open_with_config
[notmuch] / test / random-corpus.c
index d0354e3584082b0c1e1b55f307b56f131acfbb4a..7cde22c5aed34d9dfe3061bcda96bae6714b4306 100644 (file)
@@ -141,7 +141,6 @@ main (int argc, char **argv)
     void *ctx = talloc_new (NULL);
 
     const char *config_path = NULL;
     void *ctx = talloc_new (NULL);
 
     const char *config_path = NULL;
-    notmuch_config_t *config;
     notmuch_database_t *notmuch;
 
     int num_messages = 500;
     notmuch_database_t *notmuch;
 
     int num_messages = 500;
@@ -179,12 +178,12 @@ main (int argc, char **argv)
        exit (1);
     }
 
        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);
        return 1;
 
     srandom (seed);