193b81803d0c1eeec0d5e8fe849bb3a8301e7fe9
[strongswan.git] / Source / testing / leak_detective_test.c
1 /**
2 * @file leak_detective_test.h
3 *
4 * @brief Tests for the leak_detective_test.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #include "leak_detective_test.h"
24
25
26 void a()
27 {
28 malloc(4);
29 }
30
31 void b()
32 {
33 a();
34 malloc(5);
35 }
36
37 void c()
38 {
39 b();
40 malloc(6);
41 }
42
43
44 /*
45 * described in Header-File
46 */
47 void test_leak_detective(protected_tester_t *tester)
48 {
49 void *m1, *m2, *m3;
50
51
52 m1 = malloc(1);
53 m2 = calloc(1, 2);
54 m3 = malloc(3);
55
56 m3 = realloc(m3, 4);
57
58 free(m2);
59 free(m3);
60 free(m1);
61
62 //c();
63 }