2 * This file is part of mutest, a simple micro unit testing framework for C.
4 * mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
5 * under the BOLA license, please see the LICENSE file or visit:
6 * http://blitiri.com.ar/p/bola/
8 * This is the sum module test suite. It shows how to have multiple test
9 * suites, test suite initialization and termination, and a test suite that
10 * succeed. Each (public) function starting with mu_init will be picked up by
11 * mkmutest as an initialization function and executed unless one fails
12 * (returns != 0) Functions starting with mu_term will be used as termination
13 * functions, called after all test cases were executed. Functions starting
14 * with mu_test will be used as test cases.
16 * Please, read the README file for more details.
20 #include <stdlib.h> /* malloc(), free() */
23 #include "../py/mutest.h"
25 #include "../mutest.h"
28 /* unused, just for ilustrate the test suite initialization/termination */
32 global = (char*) malloc(1024);
34 return 0; /* initialization OK */
38 mu_check(sum(4, 5) == 9);
39 mu_check(sum(-4, -5) == -9);
40 mu_check(sum(0, 0) == 0);
41 mu_check(sum(1, -1) == 0);