]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - lib/blkid/tst_types.c
3003c8b5b3d62f8858e1aaeafafd6b7957b27882
[thirdparty/e2fsprogs.git] / lib / blkid / tst_types.c
1 /*
2 * This testing program makes sure the blkid_types header file
3 *
4 * Copyright (C) 2006 by Theodore Ts'o.
5 *
6 * %Begin-Header%
7 * This file may be redistributed under the terms of the GNU Public
8 * License.
9 * %End-Header%
10 */
11
12 #include <sys/types.h>
13 #include "blkid/blkid_types.h"
14
15 #include <stdlib.h>
16 #include <stdio.h>
17
18 int main(int argc, char **argv)
19 {
20 if (sizeof(__u8) != 1) {
21 printf("Sizeof(__u8) is %d should be 1\n",
22 (int)sizeof(__u8));
23 exit(1);
24 }
25 if (sizeof(__s8) != 1) {
26 printf("Sizeof(_s8) is %d should be 1\n",
27 (int)sizeof(__s8));
28 exit(1);
29 }
30 if (sizeof(__u16) != 2) {
31 printf("Sizeof(__u16) is %d should be 2\n",
32 (int)sizeof(__u16));
33 exit(1);
34 }
35 if (sizeof(__s16) != 2) {
36 printf("Sizeof(__s16) is %d should be 2\n",
37 (int)sizeof(__s16));
38 exit(1);
39 }
40 if (sizeof(__u32) != 4) {
41 printf("Sizeof(__u32) is %d should be 4\n",
42 (int)sizeof(__u32));
43 exit(1);
44 }
45 if (sizeof(__s32) != 4) {
46 printf("Sizeof(__s32) is %d should be 4\n",
47 (int)sizeof(__s32));
48 exit(1);
49 }
50 if (sizeof(__u64) != 8) {
51 printf("Sizeof(__u64) is %d should be 8\n",
52 (int)sizeof(__u64));
53 exit(1);
54 }
55 if (sizeof(__s64) != 8) {
56 printf("Sizeof(__s64) is %d should be 8\n",
57 (int)sizeof(__s64));
58 exit(1);
59 }
60 printf("The blkid_types.h types are correct.\n");
61 exit(0);
62 }
63