summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 02:10:30 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-24 02:10:30 (GMT)
commitd818edb110b668489d5c33ebc5c94dd9ef767121 (patch)
tree8c090b000e6676aa6cc36722140857b6dfe339f0 /test
parent02abb65dde9beccb289bc5ef1df3ea0ceaa41379 (diff)
parentfe104cc38ffbdb39d3e04da107d86ebfc7e8b622 (diff)
downloadhdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.zip
hdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.tar.gz
hdf5-d818edb110b668489d5c33ebc5c94dd9ef767121.tar.bz2
Merge pull request #1610 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_fixbug:develop to develop
* commit 'fe104cc38ffbdb39d3e04da107d86ebfc7e8b622': Test improvement Description Moved the new tests to a more appropriate test function. Platforms tested: Linux/64 (jelly) Fixed HDFFV-10210 and HDFFV-10587 Description: - Added parameter validation (HDFFV-10210) - Added detection of division by zero (HDFFV-10587 - CVE-2018-17438) - Fixed typos in various tests Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1011test)
Diffstat (limited to 'test')
-rw-r--r--test/tid.c28
-rw-r--r--test/titerate.c2
2 files changed, 26 insertions, 4 deletions
diff --git a/test/tid.c b/test/tid.c
index 8a27c3b..7f61c6a 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -251,7 +251,10 @@ static int id_predefined_test(void )
testObj = HDmalloc(sizeof(int));
- /* Try to perform illegal functions on various predefined types */
+ /*
+ * Attempt to perform public functions on various library types
+ */
+
H5E_BEGIN_TRY
testID = H5Iregister(H5I_FILE, testObj);
H5E_END_TRY
@@ -292,7 +295,26 @@ static int id_predefined_test(void )
if(testErr >= 0)
goto out;
- /* Create a datatype ID and try to perform illegal functions on it */
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_GROUP);
+ H5E_END_TRY
+
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_ATTR);
+ H5E_END_TRY
+
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
+
+ /*
+ * Create a datatype ID and try to perform illegal functions on it
+ */
+
typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
if(typeID == H5I_INVALID_HID)
@@ -317,7 +339,7 @@ static int id_predefined_test(void )
H5Tclose(typeID);
/* testObj was never registered as an atom, so it will not be
- * automatically freed. */
+ * automatically freed. */
HDfree(testObj);
return 0;
diff --git a/test/titerate.c b/test/titerate.c
index 8c0ef24..a3bbd65 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -946,7 +946,7 @@ find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data)
if (searched_err == NULL)
return -1;
-
+
/* If the searched error message is found, stop the iteration */
if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0)
{