]> git.notmuchmail.org Git - notmuch/blobdiff - test/T640-database-modified.sh
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / test / T640-database-modified.sh
index e35e35f64289d5b84c11b5c0d244e7d3f6e09728..2c3fa7356134664e37fe04f8148656f495c9ae42 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 test_description="DatabaseModifiedError handling"
-. ./test-lib.sh || exit 1
+. $(dirname "$0")/test-lib.sh || exit 1
 
 # add enough messages to trigger the exception
 add_email_corpus
@@ -10,11 +10,8 @@ test_begin_subtest "catching DatabaseModifiedError in _notmuch_message_ensure_me
 first_id=$(notmuch search --output=messages '*'| head -1 | sed s/^id://)
 
 test_C ${MAIL_DIR} <<EOF
-#include <unistd.h>
-#include <stdlib.h>
 #include <notmuch-test.h>
-#include <talloc.h>
-#include <assert.h>
+
 int
 main (int argc, char **argv)
 {
@@ -26,14 +23,22 @@ main (int argc, char **argv)
     notmuch_query_t *query;
     notmuch_tags_t *tags;
     int i;
+    char* msg = NULL;
 
-    EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_ONLY, &ro_db));
+    EXPECT0(notmuch_database_open_with_config (argv[1],
+                                              NOTMUCH_DATABASE_MODE_READ_ONLY,
+                                              "", NULL, &ro_db, &msg));
+    if (msg) fputs (msg, stderr);
     assert(ro_db);
 
     EXPECT0 (notmuch_database_find_message (ro_db, "${first_id}", &ro_message));
     assert(ro_message);
 
-    EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &rw_db));
+    EXPECT0(notmuch_database_open_with_config (argv[1],
+                                              NOTMUCH_DATABASE_MODE_READ_WRITE,
+                                              "", NULL, &rw_db, &msg));
+    if (msg) fputs (msg, stderr);
+
     query = notmuch_query_create(rw_db, "");
     EXPECT0 (notmuch_query_search_messages (query, &messages));