notmuch/test/notmuch-test.h
David Bremner cc1a6d2a94 test: factor out some boilerplate from C tests
The trick of having a common header file doesn't work to share between
test scripts, so make an include file in the test directory.

The use of #include <notmuch-test.h> looks slightly pretentious, but
the include file is not actually in the current (temporary) directory.
2016-06-13 21:52:33 -03:00

16 lines
279 B
C

#ifndef _NOTMUCH_TEST_H
#define _NOTMUCH_TEST_H
#include <stdio.h>
#include <notmuch.h>
inline static void
expect0(int line, notmuch_status_t ret)
{
if (ret) {
fprintf (stderr, "line %d: %s\n", line, ret);
exit (1);
}
}
#define EXPECT0(v) expect0(__LINE__, v);
#endif