]> git.ozlabs.org Git - ccan/blob - ccan/structeq/test/run.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / structeq / test / run.c
1 #include <ccan/structeq/structeq.h>
2 #include <ccan/tap/tap.h>
3
4 struct mydata {
5         int start, end;
6 };
7
8 STRUCTEQ_DEF(mydata, 0, start, end);
9
10 int main(void)
11 {
12         struct mydata a, b;
13
14         /* This is how many tests you plan to run */
15         plan_tests(3);
16
17         a.start = 0;
18         a.end = 100;
19         ok1(mydata_eq(&a, &a));
20
21         b = a;
22         ok1(mydata_eq(&a, &b));
23
24         b.end++;
25         ok1(!mydata_eq(&a, &b));
26
27         /* This exits depending on whether all tests passed */
28         return exit_status();
29 }