16 #ifndef QEV_ENABLE_MOCK
21 #define QEV_MOCK(fn_ret, fn, ...) fn(__VA_ARGS__)
28 #define QEV_MOCK(fn_ret, fn, ...) \
31 if (_qev_mock_is_mocked(__func__, G_STRINGIFY(fn))) { \
32 ret = (fn_ret)_qev_mock_run(__func__, G_STRINGIFY(fn), \
35 ret = (fn_ret)fn(__VA_ARGS__); \
79 gboolean _qev_mock_is_mocked(
const gchar *parent,
const gchar *fn);
85 guint64 _qev_mock_run(
const gchar *parent,
const gchar *fn, ...);
void qev_mock_done()
Clears all the mocks.
guint64(* qev_mock_cb)(va_list args)
Function type for callbacks from mocks.
Definition: mock.h:48
Provides all the qev_* functions that are needed for creating an event loop.
void qev_mock_add(const gchar *parent, const gchar *fn, const guint64 ret, const qev_mock_cb cb, const gint err)
Adds a mock to the current run suite.