X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Frandom-corpus.c;h=8ae08971478a2a639b249a08b1fd96c1c432b8ec;hb=HEAD;hp=9272afda8bedab235293a870ed9de794943e6dc0;hpb=c3a683299d4c27d6eadaacf4fb516f73a6c69fc3;p=notmuch diff --git a/test/random-corpus.c b/test/random-corpus.c index 9272afda..8ae08971 100644 --- a/test/random-corpus.c +++ b/test/random-corpus.c @@ -50,7 +50,7 @@ typedef struct { /* * Choose about half ascii as test characters, as ascii - * punctation and whitespace is the main cause of problems for + * punctuation and whitespace is the main cause of problems for * the (old) restore parser. * * We then favour code points with 2 byte encodings. Note that @@ -116,13 +116,14 @@ random_utf8_string (void *ctx, size_t char_count) /* stubs since we cannot link with notmuch.o */ const notmuch_opt_desc_t notmuch_shared_options[] = { - { } + { } }; const char *notmuch_requested_db_uuid = NULL; void -notmuch_process_shared_options (unused (const char *dummy)) +notmuch_process_shared_options (unused (notmuch_database_t *notmuch), + unused (const char *dummy)) { } @@ -141,7 +142,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,17 +179,18 @@ 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, ¬much)) + if (notmuch_database_open_with_config (NULL, + NOTMUCH_DATABASE_MODE_READ_WRITE, + config_path, + NULL, + ¬much, + NULL)) return 1; srandom (seed); int count; + for (count = 0; count < num_messages; count++) { int j; /* explicitly allow zero tags */