Blob


1 /*
2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
10 *
11 * test program for portab.h and friends ;-)
12 */
15 #include "portab.h"
17 static char UNUSED id[] = "$Id: portabtest.c,v 1.13 2005/07/31 20:13:11 alex Exp $";
19 #include "imp.h"
20 #include <stdarg.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
25 #include "exp.h"
28 static void Panic PARAMS (( char *Reason, int Code ));
31 GLOBAL int
32 main( void )
33 {
34 /* validate datatypes */
35 if( false != 0 ) Panic( "false", 1 );
36 if( true != 1 ) Panic( "true", 1 );
37 if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
38 if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
39 if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
41 #ifdef PROTOTYPES
42 /* check functions */
43 if( ! snprintf ) Panic( "snprintf", 2 );
44 if( ! vsnprintf ) Panic( "vsnprintf", 2 );
45 if( ! strlcpy ) Panic( "strlcpy", 2 );
46 if( ! strlcat ) Panic( "strlcat", 2 );
47 #endif
49 /* ok, no error */
50 return 0;
51 } /* portab_check_types */
54 static void
55 Panic( char *Reason, int Code )
56 {
57 /* Oops, something failed!? */
58 fprintf( stderr, "Oops, test for %s failed!?", Reason );
59 exit( Code );
60 } /* Panic */
63 /* -eof- */