]> arthur.barton.de Git - ngircd.git/blob - src/portab/portabtest.c
New "Debian release" 21.1-0ab2
[ngircd.git] / src / portab / portabtest.c
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
12 #include "portab.h"
13
14 /**
15  * @file
16  * Test program for portab.h and friends ;-)
17  */
18
19 #include "imp.h"
20 #include <stdarg.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24
25 #include "exp.h"
26
27 int allow_severity = 0, deny_severity = 0;
28
29
30 static void Panic PARAMS (( char *Reason, int Code ));
31
32
33 GLOBAL int
34 main( void )
35 {
36         /* validate datatypes */
37         if( false != 0 ) Panic( "false", 1 );
38         if( true != 1 ) Panic( "true", 1 );
39         if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
40         if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
41         if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
42
43 #ifdef PROTOTYPES
44         /* check functions */
45         if( ! snprintf ) Panic( "snprintf", 2 );
46         if( ! vsnprintf ) Panic( "vsnprintf", 2 );
47         if( ! strlcpy ) Panic( "strlcpy", 2 );
48         if( ! strlcat ) Panic( "strlcat", 2 );
49 #endif
50         
51         /* ok, no error */
52         return 0;
53 } /* portab_check_types */
54
55
56 static void
57 Panic( char *Reason, int Code )
58 {
59         /* Oops, something failed!? */
60         fprintf( stderr, "Oops, test for %s failed!?", Reason );
61         exit( Code );
62 } /* Panic */
63
64
65 /* -eof- */