blob: c7a34b8b05ca5edcb601241aa99bf08118c282a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/* file minunit_example.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../src/common.h"
#include "minunit.h"
int tests_run = 0;
void *xmalloc = malloc;
void *xrealloc = realloc;
char *
test_lowercase ()
{
char source[] = "This is a Test!";
int result;
lowercase (source);
result = memcmp ("this is a test!", source, strlen (source));
mu_assert ("lowercase failed", result == 0);
return 0;
}
char *
all_tests ()
{
mu_run_test (test_lowercase);
return 0;
}
int
main (int argc, char **argv)
{
char *result = all_tests ();
printf ("%d\n", (int) result);
if (result != 0)
{
printf ("%s\n", result);
}
else
{
printf ("ALL TESTS PASSED\n");
}
printf ("Tests run: %d\n", tests_run);
return result != 0;
}
|