summaryrefslogtreecommitdiffstats
path: root/test/tconfig.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-10-13 04:04:21 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-10-13 04:04:21 (GMT)
commit451f5b1b11696c00d193f0a7c20b64d074065177 (patch)
tree3387f2c6dce280d0443c197547cae0431db82849 /test/tconfig.c
parentb41e7eda1989005bd36c713ffec14e4693d0f722 (diff)
downloadhdf5-451f5b1b11696c00d193f0a7c20b64d074065177.zip
hdf5-451f5b1b11696c00d193f0a7c20b64d074065177.tar.gz
hdf5-451f5b1b11696c00d193f0a7c20b64d074065177.tar.bz2
[svn-r17635] Bug 1192:
Added EXIT_SUCEESS and EXIT_FAILURE macro values test. Tested: h5committested.
Diffstat (limited to 'test/tconfig.c')
-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);
+}