summaryrefslogtreecommitdiffstats
path: root/test/tid.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-03-14 23:02:21 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-03-14 23:02:21 (GMT)
commitd1d9335d7a48bc43e7dda304e15caa517fedaabf (patch)
treef7b9102017482546f22f387e8b8c1e8b47e96b0d /test/tid.c
parentfbcc3e84c0ca87fdd528afe74bf730618d4b23e5 (diff)
downloadhdf5-d1d9335d7a48bc43e7dda304e15caa517fedaabf.zip
hdf5-d1d9335d7a48bc43e7dda304e15caa517fedaabf.tar.gz
hdf5-d1d9335d7a48bc43e7dda304e15caa517fedaabf.tar.bz2
[svn-r10216]
Purpose: Bug fix Description: Calling H5Iobject_verify on an invalid type of ID (e.g., H5I_BADID) triggers an assert. Solution: Test for this condition and return an error instead of an assert. Added tests for this case. Platforms tested: sleipnir (minor change)
Diffstat (limited to 'test/tid.c')
-rw-r--r--test/tid.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/tid.c b/test/tid.c
index 1e6fe02..3e931a5 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -22,7 +22,7 @@ static int id_test(void)
testObj = malloc(7 * sizeof(int));
- /* Try to register an ID with ficticious type #420 */
+ /* Try to register an ID with ficticious types */
H5E_BEGIN_TRY
arrayID = H5Iregister((H5I_type_t) 420, testObj);
H5E_END_TRY
@@ -31,6 +31,31 @@ static int id_test(void)
if(arrayID != H5I_INVALID_HID)
goto out;
+ H5E_BEGIN_TRY
+ arrayID = H5Iregister((H5I_type_t) -1, testObj);
+ H5E_END_TRY
+
+ VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister");
+ if(arrayID != H5I_INVALID_HID)
+ goto out;
+
+ /* Try to access IDs with ficticious types */
+ H5E_BEGIN_TRY
+ testObj = H5Iobject_verify(100, (H5I_type_t) 0);
+ H5E_END_TRY
+
+ VERIFY(arrayID, NULL, "H5Iobject_verify");
+ if(testObj != NULL)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testObj = H5Iobject_verify(700, (H5I_type_t) 700);
+ H5E_END_TRY
+
+ VERIFY(arrayID, NULL, "H5Iobject_verify");
+ if(testObj != NULL)
+ goto out;
+
/* Register a type */
myType = H5Iregister_type(64, 0, (H5I_free_t) free );