]> git.ozlabs.org Git - ccan/blob - ccan/array_size/test/run.c
ttxml: removed cruft from tests
[ccan] / ccan / array_size / test / run.c
1 #include <ccan/array_size/array_size.h>
2 #include <ccan/tap/tap.h>
3
4 static char array1[1];
5 static int array2[2];
6 static unsigned long array3[3][5];
7 struct foo {
8         unsigned int a, b;
9         char string[100];
10 };
11 static struct foo array4[4];
12
13 /* Make sure they can be used in initializers. */
14 static int array1_size = ARRAY_SIZE(array1);
15 static int array2_size = ARRAY_SIZE(array2);
16 static int array3_size = ARRAY_SIZE(array3);
17 static int array4_size = ARRAY_SIZE(array4);
18
19 int main(int argc, char *argv[])
20 {
21         plan_tests(8);
22         ok1(array1_size == 1);
23         ok1(array2_size == 2);
24         ok1(array3_size == 3);
25         ok1(array4_size == 4);
26
27         ok1(ARRAY_SIZE(array1) == 1);
28         ok1(ARRAY_SIZE(array2) == 2);
29         ok1(ARRAY_SIZE(array3) == 3);
30         ok1(ARRAY_SIZE(array4) == 4);
31
32         return exit_status();
33 }