source: trunk/mondo/src/test/test-mem.c @ 1106

Last change on this file since 1106 was 1106, checked in by bruno, 13 years ago

merge -r1082:1105 $SVN_M/branches/stable

File size: 478 bytes
Line 
1#include <mr_mem.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <assert.h>
5
6void is_null(const char* str)
7{
8  if (str == NULL)
9        printf("pointer is null\n");
10  else
11        printf("pointer is NOT null\n");
12}
13
14int main(void)
15{
16  char* str = NULL;
17
18  printf("*** Test with mr_free\n");
19  str = mr_malloc(10);
20  is_null(str);
21  mr_free(str);
22  is_null(str);
23
24  printf("*** Test with NULL\n");
25  str = NULL;
26  is_null(str);
27  mr_free(str);
28  is_null(str);
29
30  return 0;
31}
32
Note: See TracBrowser for help on using the repository browser.