From fe104cc38ffbdb39d3e04da107d86ebfc7e8b622 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 21 Mar 2019 11:09:17 -0500 Subject: Test improvement Description Moved the new tests to a more appropriate test function. Platforms tested: Linux/64 (jelly) --- test/tid.c | 43 +++++++++++++++++++++++++------------------ 1 file 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; -- cgit v0.12