From 3381872933f96899efbbaf31cd832ff6b2ccb0cc Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 14 Jul 2022 11:30:59 -0500 Subject: add lily_mock_use --- lily-test.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lily-test.c') 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; -- cgit v1.2.1