diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-02-17 23:02:29 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:46 +0200 |
commit | df538463687d768b6ee8247ff4412b78850e7404 (patch) | |
tree | 52f42c02ef8139e5d73a8504e1bb3e896f3c0bc9 /bcc/misc/test/castest.t | |
parent | d91fa39567f5659e3931cf61517d62fddcd87570 (diff) | |
download | dev86-0.16.2.tar.gz |
Import Dev86src-0.16.2.tar.gzv0.16.2
Diffstat (limited to 'bcc/misc/test/castest.t')
-rw-r--r-- | bcc/misc/test/castest.t | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/bcc/misc/test/castest.t b/bcc/misc/test/castest.t deleted file mode 100644 index ae27f7b..0000000 --- a/bcc/misc/test/castest.t +++ /dev/null @@ -1,74 +0,0 @@ -/* castest.c */ - -/* -#define signedchar -#define bigints -*/ -#define unsigchar -#define unsigshort -#define unsiglong - -#define TEST(u,c) if ( (u) != (c) )\ - { printf( "u != c\n" ); ++bad; } ++possible - -main() -{ - int bad; - int possible; - char c; -#ifdef signedchar - signed char sc; -#endif -#ifdef unsigchar - unsigned char uc; -#endif - short s; -#ifdef unsigshort - unsigned short us; -#endif - int i; - unsigned u; - long l; -#ifdef unsiglong - unsigned long ul; -#endif - - bad = possible = 0; - u = 0x1ff; - c = (char) u; - if ( c < 0 ) - printf( "characters are signed\n" ); - TEST((char)u,c); - i = (int)(char) u; - TEST(i,(int)c); - TEST((int)(char)u,i); - -#ifdef signedchar - sc = (signed char) u; - if ( sc >= 0 ) - printf( "??? signed char not signed\n" ); - TEST((signed char)u,sc); - TEST((int)(signed char)u,(int)sc); - i = (int) sc; - TEST((int)(signed char)u,i); -#endif - -#ifdef bigints - u = 0x1ffff; - s = (short) u; - TEST((short)u,s); - TEST((int)(short)u,(int)s); - i = (int) s; - TEST((int)(short)u,i); - -#ifdef unsigshort - us = (unsigned short) u; - TEST((unsigned short)u,us); - TEST((int)(unsigned short)u,(int)us); - i = (int) us; - TEST((int)(unsigned short)u,i); -#endif -#endif - - printf( "%d bad out of a possible %d\n", bad, possible ); -} |