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