0.0.1
Usage
#include <stdlib.h>
#include <stdio.h>
#include <leak_test.h>
bool test(void *context)
{
leak_test_start();
// do what you want
// printf uses malloc inside.
// to NOT check leak for printf, skip leak test
leak_test_end();
printf("Hello world!\n");
leak_test_start();
// do what you want
return (false);
}
int main(void)
{
const int error = leak_test(&test, NULL);
if (error == FT_LEAK_TEST_RESULT_ERROR)
puts("Error occurred");
else if (error == FT_LEAK_TEST_RESULT_LEAK)
puts("LEAK FOUND!!!");
return (0);
}