]> arthur.barton.de Git - ngircd-alex.git/blob - src/portab/portabtest.c
Code cleanup: mostly removing empty lines
[ngircd-alex.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
28 static void Panic PARAMS (( char *Reason, int Code ));
29
30
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 );
40
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
48         
49         /* ok, no error */
50         return 0;
51 } /* portab_check_types */
52
53
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 */
61
62
63 /* -eof- */