]> git.notmuchmail.org Git - notmuch/blobdiff - test/symbol-test.cc
lib: add "verbose" versions of notmuch_database_{open,create}
[notmuch] / test / symbol-test.cc
index 3e96c034e13e94412285bcde6dd2d74e870993d2..d979f832cb599fdc69b8ef33cf8e63d40f3ee7cc 100644 (file)
@@ -1,11 +1,18 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <xapian.h>
 #include <notmuch.h>
 
 
 int main() {
   notmuch_database_t *notmuch;
-  notmuch_database_open("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch);
+  char *message = NULL;
+
+  if (notmuch_database_open_verbose  ("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch, &message))
+      if (message) {
+         fputs (message, stderr);
+         free (message);
+      }
 
   try {
     (void) new Xapian::WritableDatabase("./nonexistant", Xapian::DB_OPEN);