mtest5.c

/* this shows how you fail an allocation */
#define MALLOC_CHECK_STORE my_malloc_check
#include "mk.h"

MALLOC_CHECK_DECL();

int main(void)
{
  void *ptr = NULL;

  my_malloc_check.mem_fail_num = 1;
  if ((ptr = MK(1)))
    return (EXIT_FAILURE);
  
  MALLOC_CHECK_EMPTY();

  return (EXIT_SUCCESS);
}