rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

test_utils.h (373B)


      1 #ifndef TEST_UTILS_H
      2 #define TEST_UTILS_H
      3 
      4 #include "mem_allocator.h"
      5 #include <stdio.h>
      6 
      7 static void
      8 check_memory_allocator(struct mem_allocator* allocator)
      9 {
     10   if(MEM_ALLOCATED_SIZE(allocator)) {
     11     char dump[512];
     12     MEM_DUMP(allocator, dump, sizeof(dump)/sizeof(char));
     13     fprintf(stderr, "%s\n", dump);
     14     FATAL("Memory leaks\n");
     15   }
     16 }
     17 
     18 #endif /* TEST_UTILS_H */