From 451f5b1b11696c00d193f0a7c20b64d074065177 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 12 Oct 2009 23:04:21 -0500 Subject: [svn-r17635] Bug 1192: Added EXIT_SUCEESS and EXIT_FAILURE macro values test. Tested: h5committested. --- test/tconfig.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/tconfig.c b/test/tconfig.c index 355191d..47eed64 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -47,6 +47,7 @@ /* local routine prototypes */ void test_config_ctypes(void); +void test_exit_definitions(void); /*------------------------------------------------------------------------- @@ -69,6 +70,7 @@ test_configure(void) /* Output message about test being performed */ MESSAGE(5, ("Testing configure definitions\n")); test_config_ctypes(); + test_exit_definitions(); } @@ -202,3 +204,31 @@ test_config_ctypes(void) #endif } + + +/*------------------------------------------------------------------------- + * Function: test_exit_definitions + * + * Purpose: test the exit macros values + * + * Return: none (error is fed back via global variable num_errs) + * + * Programmer: Albert Cheng + * October 12, 2009 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +test_exit_definitions(void) +{ + /* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */ + /* This should be true for POSIX compliant systems. */ + if (EXIT_SUCCESS != 0) \ + TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ + EXIT_SUCCESS, 0); + if (EXIT_FAILURE != 1) \ + TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ + EXIT_FAILURE, 1); +} -- cgit v0.12