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() */
22 #include "../mutest.h"
24 /* unused, just for ilustrate the test suite initialization/termination */
28 global = (char*) malloc(1024);
30 return 0; /* initialization OK */
34 mu_check(sum(4, 5) == 9);
35 mu_check(sum(-4, -5) == -9);
36 mu_check(sum(0, 0) == 0);
37 mu_check(sum(1, -1) == 0);