1 #ifndef _NOTMUCH_TEST_H
2 #define _NOTMUCH_TEST_H
14 #include <sys/types.h>
22 expect0 (int line, notmuch_status_t ret)
25 fprintf (stderr, "line %d: %d\n", line, ret);
30 #define EXPECT0(v) expect0 (__LINE__, v);
33 dlsym_next (const char *symbol)
35 void *sym = dlsym (RTLD_NEXT, symbol);
36 char *str = dlerror ();
39 fprintf (stderr, "finding symbol '%s' failed: %s", symbol, str);
45 #define WRAP_DLFUNC(_rtype, _func, _args) \
47 _rtype _func _args { \
48 static _rtype (*_func##_orig) _args = NULL; \
49 if (! _func##_orig ) *(void **) (&_func##_orig) = dlsym_next (#_func);