Wrap malloc/realloc/free calls in something that can be modified for tests

Issue #20 resolved
Sean Kauffman repo owner created an issue

Right now, none of the unable to allocate error handling code is tested because it is hard to get malloc to fail predictably (or at all). Wrap all these calls in our own API that can return zero when tests require it.

See: https://stackoverflow.com/questions/38023749/make-malloc-fail-voluntarily-in-order-to-test-the-cases-when-malloc-fails

This is related to Issue #17

Comments (1)

  1. Sean Kauffman reporter

    This has now been resolved by the testio.c functionality. It remains to incorporate this into testing for the whole project, but there is now a simple method to override memory management syscalls.

  2. Log in to comment