aboutsummaryrefslogtreecommitdiff
path: root/test/T560-lib-error.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-05-21 15:06:30 -0300
committerDavid Bremner <david@tethera.net>2022-05-29 07:36:44 -0300
commit32f299fe137a4ac731750d576e65337b395a42ef (patch)
treeb40219069acb07b65e8ffbd1de4b3badc5105974 /test/T560-lib-error.sh
parentf6e7a9dde5a7d9c2fa390a15888704c31852a538 (diff)
test: replace deprecated use of notmuch_database_open
This is a bit more involved than replacing the use of notmuch_database_open_verbose, as we have to effectively inline the definition of notmuch_database_open.
Diffstat (limited to 'test/T560-lib-error.sh')
-rwxr-xr-xtest/T560-lib-error.sh28
1 files changed, 23 insertions, 5 deletions
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index 1d45dc7d..470537cc 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -16,7 +16,11 @@ int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_open (NULL, 0, 0);
+ char* msg = NULL;
+ stat = notmuch_database_open_with_config (NULL,
+ NOTMUCH_DATABASE_MODE_READ_ONLY,
+ "", NULL, &db, &msg);
+ if (msg) fputs (msg, stderr);
}
EOF
cat <<'EOF' >EXPECTED
@@ -34,7 +38,11 @@ int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_open ("./nonexistent/foo", 0, 0);
+ char *msg = NULL;
+ stat = notmuch_database_open_with_config ("./nonexistent/foo",
+ NOTMUCH_DATABASE_MODE_READ_ONLY,
+ "", NULL, &db, &msg);
+ if (msg) fputs (msg, stderr);
}
EOF
cat <<'EOF' >EXPECTED
@@ -70,7 +78,11 @@ int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_open (argv[1], 0, 0);
+ char* msg = NULL;
+ stat = notmuch_database_open_with_config (argv[1],
+ NOTMUCH_DATABASE_MODE_READ_ONLY,
+ "", NULL, &db, &msg);
+ if (msg) fputs (msg, stderr);
}
EOF
cat <<'EOF' >EXPECTED
@@ -123,7 +135,11 @@ int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, &db);
+ char* msg = NULL;
+ stat = notmuch_database_open_with_config (argv[1],
+ NOTMUCH_DATABASE_MODE_READ_ONLY,
+ "", NULL, &db, &msg);
+ if (msg) fputs (msg, stderr);
if (stat != NOTMUCH_STATUS_SUCCESS) {
fprintf (stderr, "error opening database: %d\n", stat);
}
@@ -148,7 +164,9 @@ int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db);
+ stat = notmuch_database_open_with_config (argv[1],
+ NOTMUCH_DATABASE_MODE_READ_WRITE,
+ "", NULL, &db, NULL);
if (stat != NOTMUCH_STATUS_SUCCESS) {
fprintf (stderr, "error opening database: %d\n", stat);
}