2002-03-12 15:36:44 +01:00
|
|
|
/*
|
|
|
|
* ngIRCd -- The Next Generation IRC Daemon
|
|
|
|
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
|
|
|
*
|
2002-12-12 12:37:11 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
* Please read the file COPYING, README and AUTHORS for more information.
|
2002-03-12 15:36:44 +01:00
|
|
|
*
|
2002-12-12 12:37:11 +01:00
|
|
|
* test program for portab.h and friends ;-)
|
2002-03-12 15:36:44 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "portab.h"
|
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
static char UNUSED id[] = "$Id: portabtest.c,v 1.12 2005/03/19 18:43:50 fw Exp $";
|
2002-12-12 12:37:11 +01:00
|
|
|
|
2002-03-12 15:36:44 +01:00
|
|
|
#include "imp.h"
|
2002-12-26 14:19:36 +01:00
|
|
|
#include <stdarg.h>
|
2002-03-12 15:36:44 +01:00
|
|
|
#include <stdio.h>
|
2002-12-26 14:19:36 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2002-03-12 15:36:44 +01:00
|
|
|
|
|
|
|
#include "exp.h"
|
|
|
|
|
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
LOCAL void Panic PARAMS (( char *Reason, int Code ));
|
2002-12-26 14:19:36 +01:00
|
|
|
|
|
|
|
|
2002-05-27 15:00:50 +02:00
|
|
|
GLOBAL int
|
2005-03-19 19:43:48 +01:00
|
|
|
main( void )
|
2002-03-12 15:36:44 +01:00
|
|
|
{
|
2002-12-26 14:19:36 +01:00
|
|
|
/* validate datatypes */
|
2005-03-19 19:43:48 +01:00
|
|
|
if( false != 0 ) Panic( "false", 1 );
|
|
|
|
if( true != 1 ) Panic( "true", 1 );
|
2002-12-26 14:19:36 +01:00
|
|
|
if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
|
|
|
|
if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
|
|
|
|
if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
|
|
|
|
|
2003-01-04 11:40:01 +01:00
|
|
|
#ifdef PROTOTYPES
|
2002-12-26 14:19:36 +01:00
|
|
|
/* check functions */
|
|
|
|
if( ! snprintf ) Panic( "snprintf", 2 );
|
|
|
|
if( ! vsnprintf ) Panic( "vsnprintf", 2 );
|
|
|
|
if( ! strlcpy ) Panic( "strlcpy", 2 );
|
|
|
|
if( ! strlcat ) Panic( "strlcat", 2 );
|
2003-01-04 11:40:01 +01:00
|
|
|
#endif
|
2002-09-09 12:05:10 +02:00
|
|
|
|
2002-12-26 14:19:36 +01:00
|
|
|
/* ok, no error */
|
2002-09-09 12:05:10 +02:00
|
|
|
return 0;
|
2002-03-12 15:36:44 +01:00
|
|
|
} /* portab_check_types */
|
|
|
|
|
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
LOCAL void
|
|
|
|
Panic( char *Reason, int Code )
|
2002-12-26 14:19:36 +01:00
|
|
|
{
|
|
|
|
/* Oops, something failed!? */
|
|
|
|
fprintf( stderr, "Oops, test for %s failed!?", Reason );
|
|
|
|
exit( Code );
|
|
|
|
} /* Panic */
|
|
|
|
|
|
|
|
|
2002-03-12 15:36:44 +01:00
|
|
|
/* -eof- */
|