]> pd.if.org Git - lice/blob - testrun.c
autocommit for files dated 2014-11-17 20:15:26
[lice] / testrun.c
1
2 // some decls to suppress some warnings the compiler will emit
3 void exit(int);
4 int printf(const char *__format, ...);
5 int strcmp(const char *__s1, const char *__s2);
6 int vsprintf(char *__src, const char *__format, void *);
7 void *dlsym(void *__handle, const char *__symbol);
8 void *dlopen(const char *__library, long __flags);
9 int snprintf(char *__s, unsigned long __maxlen, const char *__format);
10
11 int external_1 = 1337;
12 int external_2 = 7331;
13
14 void expecti(int a, int b) {
15     if (a != b) {
16         printf("    Expected: %d\n", b);
17         printf("    Result:   %d\n", a);
18         exit(1);
19     }
20 }
21
22 void expectl(long a, long b) {
23     if (a != b) {
24         printf("    Expected: %d\n", b);
25         printf("    Result:   %d\n", a);
26         exit(1);
27     }
28 }
29
30 void expectf(float a, float b) {
31     if (a != b) {
32         printf("    Expected: %f\n", b);
33         printf("    Result:   %f\n", a);
34         exit(1);
35     }
36 }
37
38 void expectd(double a, double b) {
39     if (a != b) {
40         printf("    Expected: %f\n", b);
41         printf("    Result:   %f\n", a);
42         exit(1);
43     }
44 }
45
46 void expects(short a, short b) {
47     if (a != b) {
48         printf("    Expected: %s\n", b);
49         printf("    Result:   %s\n", a);
50         exit(1);
51     }
52 }
53
54 void expectstr(const char *a, const char *b) {
55     if (strcmp(a, b)) {
56         printf("    Expected: %s\n", b);
57         printf("    Result:   %s\n", a);
58         exit(1);
59     }
60 }