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