summaryrefslogtreecommitdiffstats
path: root/lib/blkid/tst_types.c
blob: cb612aeb31e3c871483c37d4a02cb2e19fc013cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * This testing program makes sure the blkid_types header file
 *
 * Copyright (C) 2006 by Theodore Ts'o.
 *
 * %Begin-Header%
 * This file may be redistributed under the terms of the GNU Public
 * License.
 * %End-Header%
 */

#include "config.h"
#include <sys/types.h>
#include "blkid/blkid_types.h"

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	if (sizeof(__u8) != 1) {
		printf("Sizeof(__u8) is %d should be 1\n",
		       (int)sizeof(__u8));
		exit(1);
	}
	if (sizeof(__s8) != 1) {
		printf("Sizeof(_s8) is %d should be 1\n",
		       (int)sizeof(__s8));
		exit(1);
	}
	if (sizeof(__u16) != 2) {
		printf("Sizeof(__u16) is %d should be 2\n",
		       (int)sizeof(__u16));
		exit(1);
	}
	if (sizeof(__s16) != 2) {
		printf("Sizeof(__s16) is %d should be 2\n",
		       (int)sizeof(__s16));
		exit(1);
	}
	if (sizeof(__u32) != 4) {
		printf("Sizeof(__u32) is %d should be 4\n",
		       (int)sizeof(__u32));
		exit(1);
	}
	if (sizeof(__s32) != 4) {
		printf("Sizeof(__s32) is %d should be 4\n",
		       (int)sizeof(__s32));
		exit(1);
	}
	if (sizeof(__u64) != 8) {
		printf("Sizeof(__u64) is %d should be 8\n",
		       (int)sizeof(__u64));
		exit(1);
	}
	if (sizeof(__s64) != 8) {
		printf("Sizeof(__s64) is %d should be 8\n",
		       (int)sizeof(__s64));
		exit(1);
	}
	printf("The blkid_types.h types are correct.\n");
	exit(0);
}