]> git.notmuchmail.org Git - notmuch/blob - test/symbol-test.cc
Merge branch 'release'
[notmuch] / test / symbol-test.cc
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <xapian.h>
4 #include <notmuch.h>
5
6 int main (int argc, char** argv)
7 {
8     notmuch_database_t *notmuch;
9     char *message = NULL;
10
11     if (argc != 3)
12         return 1;
13
14     if (notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY,
15                                        &notmuch, &message)) {
16         if (message) {
17             fputs (message, stderr);
18             free (message);
19         }
20     }
21
22     try {
23         (void) new Xapian::WritableDatabase (argv[2], Xapian::DB_OPEN);
24     } catch (const Xapian::Error &error) {
25         printf("caught %s\n", error.get_msg().c_str());
26         return 0;
27     }
28
29     return 1;
30 }