summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-21 16:09:17 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2019-03-21 16:09:17 (GMT)
commitfe104cc38ffbdb39d3e04da107d86ebfc7e8b622 (patch)
treec1276dce05fb1df259965b5e823c93e7f883adee
parent222346f3732ba3bfb007da410e1b808be129aaaf (diff)
downloadhdf5-fe104cc38ffbdb39d3e04da107d86ebfc7e8b622.zip
hdf5-fe104cc38ffbdb39d3e04da107d86ebfc7e8b622.tar.gz
hdf5-fe104cc38ffbdb39d3e04da107d86ebfc7e8b622.tar.bz2
Test improvement
Description Moved the new tests to a more appropriate test function. Platforms tested: Linux/64 (jelly)
-rw-r--r--test/tid.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/test/tid.c b/test/tid.c
index d2bcdc4..7f61c6a 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -224,21 +224,6 @@ static int basic_id_test(void)
goto out;
H5E_END_TRY
- /* Test that H5Itype_exists cannot be called on library types because
- * it is a public function
- */
- H5E_BEGIN_TRY
- err = H5Itype_exists(H5I_GROUP);
- if(err >= 0)
- goto out;
- H5E_END_TRY
-
- H5E_BEGIN_TRY
- err = H5Itype_exists(H5I_ATTR);
- if(err >= 0)
- goto out;
- H5E_END_TRY
-
return 0;
out:
@@ -266,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
@@ -307,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)
@@ -332,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;