mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
84d3b15d25
The compatibility wrapper ensures that clients calling notmuch_database_open will receive consistent output for now. The changes to notmuch-{new,search} and test/symbol-test are just to make the test suite pass. The use of IGNORE_RESULT is justified by two things. 1) I don't know what else to do. 2) asprintf guarantees the output string is NULL if an error occurs, so at least we are not passing garbage back.
25 lines
539 B
C++
25 lines
539 B
C++
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <xapian.h>
|
|
#include <notmuch.h>
|
|
|
|
|
|
int main() {
|
|
notmuch_database_t *notmuch;
|
|
char *message = NULL;
|
|
|
|
if (notmuch_database_open_verbose ("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much, &message))
|
|
if (message) {
|
|
fputs (message, stderr);
|
|
free (message);
|
|
}
|
|
|
|
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;
|
|
}
|