2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-12 17:31:09 +08:00

Test improvement

Description
    Moved the new tests to a more appropriate test function.
Platforms tested:
    Linux/64 (jelly)
This commit is contained in:
Binh-Minh Ribler 2019-03-21 11:09:17 -05:00
parent 222346f373
commit fe104cc38f

@ -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;