2006-04-09 16:41:55 +04:00
|
|
|
/*
|
|
|
|
* This testing program makes sure the ext2_types header file
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 by Theodore Ts'o.
|
2008-08-28 07:07:54 +04:00
|
|
|
*
|
2006-04-09 16:41:55 +04:00
|
|
|
* %Begin-Header%
|
2010-05-18 05:31:56 +04:00
|
|
|
* This file may be redistributed under the terms of the GNU Library
|
|
|
|
* General Public License, version 2.
|
2006-04-09 16:41:55 +04:00
|
|
|
* %End-Header%
|
|
|
|
*/
|
2007-04-05 05:09:49 +04:00
|
|
|
|
2011-09-19 01:34:37 +04:00
|
|
|
#include "config.h"
|
2007-04-05 05:09:49 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2006-04-09 16:41:55 +04:00
|
|
|
|
|
|
|
#include "ext2fs/ext2_types.h"
|
|
|
|
|
2007-05-25 19:18:11 +04:00
|
|
|
int main(int argc, char **argv)
|
2006-04-09 16:41:55 +04:00
|
|
|
{
|
|
|
|
if (sizeof(__u8) != 1) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__u8) is %d should be 1\n",
|
|
|
|
(int)sizeof(__u8));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__s8) != 1) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(_s8) is %d should be 1\n",
|
|
|
|
(int)sizeof(__s8));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__u16) != 2) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__u16) is %d should be 2\n",
|
|
|
|
(int)sizeof(__u16));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__s16) != 2) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__s16) is %d should be 2\n",
|
|
|
|
(int)sizeof(__s16));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__u32) != 4) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__u32) is %d should be 4\n",
|
|
|
|
(int)sizeof(__u32));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__s32) != 4) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__s32) is %d should be 4\n",
|
|
|
|
(int)sizeof(__s32));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__u64) != 8) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__u64) is %d should be 8\n",
|
|
|
|
(int)sizeof(__u64));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (sizeof(__s64) != 8) {
|
2007-05-25 19:18:11 +04:00
|
|
|
printf("Sizeof(__s64) is %d should be 8\n",
|
|
|
|
(int)sizeof(__s64));
|
2006-04-09 16:41:55 +04:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
printf("The ext2_types.h types are correct.\n");
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|