]> git.notmuchmail.org Git - notmuch/blobdiff - test/symbol-test.cc
tests: add a test for symbol hiding side effects
[notmuch] / test / symbol-test.cc
diff --git a/test/symbol-test.cc b/test/symbol-test.cc
new file mode 100644 (file)
index 0000000..1de06ea
--- /dev/null
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <xapian.h>
+#include <notmuch.h>
+main (int argc, char **argv){
+
+    notmuch_database_t *notmuch
+      = notmuch_database_open ("fakedb",
+                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
+
+  try{
+    (void)new Xapian::WritableDatabase ("./nonexistant",                                       Xapian::DB_OPEN);
+  } catch (const Xapian::Error &error) {
+    printf("caught %s\n",error.get_msg().c_str());
+    return 0;
+  }
+  return 1;
+}