summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-10-13 03:18:55 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-10-13 03:18:55 (GMT)
commit5237ffce5278262605fa35dbef7b213c4654e879 (patch)
treecff40a8659a0c91e4323d37aa7c8d4b0dca0225b
parentd3aa5c967e7894a82246e5d1e444a9e87d3e2660 (diff)
downloadhdf5-5237ffce5278262605fa35dbef7b213c4654e879.zip
hdf5-5237ffce5278262605fa35dbef7b213c4654e879.tar.gz
hdf5-5237ffce5278262605fa35dbef7b213c4654e879.tar.bz2
[svn-r17633] Bug 1192:
Added EXIT_SUCEESS and EXIT_FAILURE macro values test. Tested: h5committested.
-rw-r--r--test/tconfig.c30
1 files changed, 30 insertions, 0 deletions
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);
+}