summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-10-13 03:19:23 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-10-13 03:19:23 (GMT)
commitf6fc22861fc78696451afa2b3cce2a3e12cce966 (patch)
tree62cad07d9143b92f114299ca42a50d5a60fb080b /test
parent75920d6790e56a4e8aa9b70ca1417579de1e6c6d (diff)
downloadhdf5-f6fc22861fc78696451afa2b3cce2a3e12cce966.zip
hdf5-f6fc22861fc78696451afa2b3cce2a3e12cce966.tar.gz
hdf5-f6fc22861fc78696451afa2b3cce2a3e12cce966.tar.bz2
[svn-r17634] Bug 1192:
Added EXIT_SUCEESS and EXIT_FAILURE macro values test. Tested: h5committested.
Diffstat (limited to 'test')
-rw-r--r--test/tconfig.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/tconfig.c b/test/tconfig.c
index d4d7d4b..158fc4f 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);
+}