Go to the documentation of this file.
15#ifndef TOR_TESTSUPPORT_H
16#define TOR_TESTSUPPORT_H
49#define EXTERN(type, name) extern type name;
51#define EXTERN(type, name)
99#define MOCK_DECL(rv, funcname, arglist) \
100 rv funcname ##__real arglist; \
101 extern rv(*funcname) arglist
103#define MOCK_IMPL(rv, funcname, arglist) \
104 rv(*funcname) arglist = funcname ##__real; \
105 rv funcname ##__real arglist
107#define MOCK_DECL_ATTR(rv, funcname, arglist, attr) \
108 rv funcname ##__real arglist attr; \
109 extern rv(*funcname) arglist
114#define MOCK(func, replacement) \
116 (func) = (replacement); \
121#define UNMOCK(func) \
123 func = func ##__real; \
127#define MOCK_DECL(rv, funcname, arglist) \
130#define MOCK_DECL_ATTR(rv, funcname, arglist, attr) \
131 rv funcname arglist attr
133#define MOCK_IMPL(rv, funcname, arglist) \