diff options
author | sanine <sanine.net@pm.me> | 2022-07-14 11:30:59 -0500 |
---|---|---|
committer | sanine <sanine.net@pm.me> | 2022-07-14 11:30:59 -0500 |
commit | 3381872933f96899efbbaf31cd832ff6b2ccb0cc (patch) | |
tree | 663f9c07184b90565431e24e6e690c92d4181fc7 /tests/mock_queue.c | |
parent | 089eead7853a9a211253f720c309328a90669b25 (diff) |
add lily_mock_use
Diffstat (limited to 'tests/mock_queue.c')
-rw-r--r-- | tests/mock_queue.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/mock_queue.c b/tests/mock_queue.c index 493d397..07a5379 100644 --- a/tests/mock_queue.c +++ b/tests/mock_queue.c @@ -118,3 +118,17 @@ const char* test_lily_mock_call() lily_mock_destroy(m); return 0; } + + +const char * test_lily_mock_use() +{ + lily_mock_t *m = NULL; + lily_mock_use(&m); + if (m == NULL) return "m was still null!"; + m->n_calls = 5; + lily_mock_use(&m); + if (m == NULL) return "m was later null!"; + if (m->n_calls != 0) return "m was not re-allocated!"; + lily_mock_destroy(m); + return 0; +} |