]> git.ozlabs.org Git - ccan/blob - ccan/structeq/test/run.c
9ecb4b7da46c7f3a4b4207665f82adafef7757e2
[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 int main(void)
9 {
10         struct mydata a, b;
11
12         /* This is how many tests you plan to run */
13         plan_tests(3);
14
15         a.start = 0;
16         a.end = 100;
17         ok1(structeq(&a, &a));
18
19         b = a;
20         ok1(structeq(&a, &b));
21
22         b.end++;
23         ok1(!structeq(&a, &b));
24
25         /* This exits depending on whether all tests passed */
26         return exit_status();
27 }