Programming for coverage part 5

The last post used custom replacement functions and allocator interfaces to simulate allocation failures for testing purposes. Those approaches work well when you control both sides of the function call, but it won&rsquo;t work if we want to test handling errors originating in libraries we don&rsquo;t control. The malloc might fail because the system is out of memory or when the resource limit is…