summaryrefslogtreecommitdiff
path: root/src/common/testsupport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/testsupport.h')
-rw-r--r--src/common/testsupport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/testsupport.h b/src/common/testsupport.h
index b98d7014c7..9ad2ba77e0 100644
--- a/src/common/testsupport.h
+++ b/src/common/testsupport.h
@@ -62,6 +62,12 @@
#define MOCK_IMPL(rv, funcname, arglist) \
rv(*funcname) arglist = funcname ##__real; \
rv funcname ##__real arglist
+#define MOCK_DECL_ATTR(rv, funcname, arglist, attr) \
+ rv funcname ##__real arglist attr; \
+ extern rv(*funcname) arglist
+#define MOCK_IMPL(rv, funcname, arglist) \
+ rv(*funcname) arglist = funcname ##__real; \
+ rv funcname ##__real arglist
#define MOCK(func, replacement) \
do { \
(func) = (replacement); \
@@ -73,6 +79,8 @@
#else
#define MOCK_DECL(rv, funcname, arglist) \
rv funcname arglist
+#define MOCK_DECL_ATTR(rv, funcname, arglist, attr) \
+ rv funcname arglist attr
#define MOCK_IMPL(rv, funcname, arglist) \
rv funcname arglist
#endif