tst_types.c revision de8f3a76218255e443ba57dec5d74850180fa75d
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 "blkid/blkid_types.h"
13
14#include <stdlib.h>
15#include <stdio.h>
16
17int main(int argc, char **argv)
18{
19	if (sizeof(__u8) != 1) {
20		printf("Sizeof(__u8) is %d should be 1\n",
21		       (int)sizeof(__u8));
22		exit(1);
23	}
24	if (sizeof(__s8) != 1) {
25		printf("Sizeof(_s8) is %d should be 1\n",
26		       (int)sizeof(__s8));
27		exit(1);
28	}
29	if (sizeof(__u16) != 2) {
30		printf("Sizeof(__u16) is %d should be 2\n",
31		       (int)sizeof(__u16));
32		exit(1);
33	}
34	if (sizeof(__s16) != 2) {
35		printf("Sizeof(__s16) is %d should be 2\n",
36		       (int)sizeof(__s16));
37		exit(1);
38	}
39	if (sizeof(__u32) != 4) {
40		printf("Sizeof(__u32) is %d should be 4\n",
41		       (int)sizeof(__u32));
42		exit(1);
43	}
44	if (sizeof(__s32) != 4) {
45		printf("Sizeof(__s32) is %d should be 4\n",
46		       (int)sizeof(__s32));
47		exit(1);
48	}
49	if (sizeof(__u64) != 8) {
50		printf("Sizeof(__u64) is %d should be 8\n",
51		       (int)sizeof(__u64));
52		exit(1);
53	}
54	if (sizeof(__s64) != 8) {
55		printf("Sizeof(__s64) is %d should be 8\n",
56		       (int)sizeof(__s64));
57		exit(1);
58	}
59	printf("The blkid_types.h types are correct.\n");
60	exit(0);
61}
62
63