summaryrefslogtreecommitdiff
path: root/lily-test.c
diff options
context:
space:
mode:
authorsanine <sanine.net@pm.me>2022-07-14 11:30:59 -0500
committersanine <sanine.net@pm.me>2022-07-14 11:30:59 -0500
commit3381872933f96899efbbaf31cd832ff6b2ccb0cc (patch)
tree663f9c07184b90565431e24e6e690c92d4181fc7 /lily-test.c
parent089eead7853a9a211253f720c309328a90669b25 (diff)
add lily_mock_use
Diffstat (limited to 'lily-test.c')
-rw-r--r--lily-test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lily-test.c b/lily-test.c
index ec0a1f7..2f43a28 100644
--- a/lily-test.c
+++ b/lily-test.c
@@ -333,6 +333,12 @@ void lily_mock_destroy(lily_mock_t *m)
free(m);
}
+void lily_mock_use(lily_mock_t **m)
+{
+ if (*m != NULL) lily_mock_destroy(*m);
+ *m = lily_mock_create();
+}
+
void _lily_mock_call(lily_mock_t *m, struct lily_mock_arg_t *args, size_t n_args)
{
m->n_calls += 1;