Adjust tkey_test.c test to mock_assert() when there's no memory

This commit is contained in:
Ondřej Surý
2019-07-23 11:55:19 -04:00
parent f0c6aef542
commit 9123da5362

View File

@@ -47,9 +47,9 @@ __wrap_isc__mem_get(isc_mem_t *mctx, size_t size)
UNUSED(mctx);
if (!has_enough_memory) {
return (NULL);
}
mock_assert(has_enough_memory, "mock isc_mem_get failed",
__FILE__, __LINE__);
return (malloc(size));
}
@@ -129,8 +129,7 @@ dns_tkeyctx_create_test(void **state) {
tctx = NULL;
will_return(__wrap_isc__mem_get, false);
assert_int_equal(dns_tkeyctx_create(&mock_mctx, &tctx),
ISC_R_NOMEMORY);
expect_assert_failure(dns_tkeyctx_create(&mock_mctx, &tctx));
tctx = NULL;
will_return(__wrap_isc__mem_get, true);