portabtest: Only use one exit code to indicate errors

This commit is contained in:
Alexander Barton 2013-12-29 17:48:25 +01:00
parent d913323ca9
commit 18070e5381
1 changed files with 12 additions and 12 deletions

View File

@ -24,33 +24,33 @@
#include "exp.h" #include "exp.h"
static void Panic PARAMS (( char *Reason, int Code )); static void Panic PARAMS((char *Reason));
GLOBAL int GLOBAL int
main(void) main(void)
{ {
/* validate datatypes */ /* validate datatypes */
if (false != 0) if (false != 0)
Panic("false", 1); Panic("false");
if (true != 1) if (true != 1)
Panic("true", 1); Panic("true");
if (sizeof(UINT8) != 1) if (sizeof(UINT8) != 1)
Panic("UINT8", 1); Panic("UINT8");
if (sizeof(UINT16) != 2) if (sizeof(UINT16) != 2)
Panic("UINT16", 1); Panic("UINT16");
if (sizeof(UINT32) != 4) if (sizeof(UINT32) != 4)
Panic("UINT32", 1); Panic("UINT32");
#ifdef PROTOTYPES #ifdef PROTOTYPES
/* check functions */ /* check functions */
if (!snprintf) if (!snprintf)
Panic("snprintf", 2); Panic("snprintf");
if (!vsnprintf) if (!vsnprintf)
Panic("vsnprintf", 2); Panic("vsnprintf");
if (!strlcpy) if (!strlcpy)
Panic("strlcpy", 2); Panic("strlcpy");
if (!strlcat) if (!strlcat)
Panic("strlcat", 2); Panic("strlcat");
#endif #endif
/* ok, no error */ /* ok, no error */
@ -58,11 +58,11 @@ main(void)
} /* portab_check_types */ } /* portab_check_types */
static void static void
Panic(char *Reason, int Code) Panic(char *Reason)
{ {
/* Oops, something failed!? */ /* Oops, something failed!? */
fprintf(stderr, "Oops, test for %s failed!?", Reason); fprintf(stderr, "Oops, test for %s failed!?", Reason);
exit(Code); exit(1);
} /* Panic */ } /* Panic */
/* -eof- */ /* -eof- */