]> git.cworth.org Git - notmuch/commitdiff
test: replace deprecated use of notmuch_database_create
authorDavid Bremner <david@tethera.net>
Sat, 21 May 2022 18:06:31 +0000 (15:06 -0300)
committerDavid Bremner <david@tethera.net>
Sun, 29 May 2022 10:36:59 +0000 (07:36 -0300)
Like notmuch_database_open, we need to conditionally print the error
message.

test/T560-lib-error.sh

index 470537cc30c02091384a50b31d09a6c82b2b0727..80527afd42beba51aa109c9e6067d81dba3fa26d 100755 (executable)
@@ -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