mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r23322] HDFFV-8322: Close resources, found from valgrind testing
Tested: local linux
This commit is contained in:
parent
00eea738d6
commit
77dedb3c64
@ -225,6 +225,9 @@ ADD_TEST (
|
||||
)
|
||||
ADD_TEST (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>)
|
||||
SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
|
||||
IF (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
SET_TESTS_PROPERTIES(testhdf5 PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600)
|
||||
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
|
11
test/tfile.c
11
test/tfile.c
@ -526,6 +526,9 @@ test_file_open(void)
|
||||
/* Close dataset from first open */
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
ret = H5Pclose(fapl_id);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
} /* test_file_open() */
|
||||
|
||||
/****************************************************************
|
||||
@ -1060,6 +1063,9 @@ test_get_file_id(void)
|
||||
VERIFY(fid2, FAIL, "H5Iget_file_id");
|
||||
|
||||
/* Close objects */
|
||||
ret = H5Pclose(plist);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
|
||||
ret = H5Tclose(datatype_id);
|
||||
CHECK(ret, FAIL, "H5Tclose");
|
||||
|
||||
@ -2855,7 +2861,7 @@ test_filespace_sects(void)
|
||||
test_free_sections(fapl_stdio, filename);
|
||||
|
||||
/* close fapl and remove the file */
|
||||
h5_cleanup(FILENAME, fapl_split);
|
||||
h5_cleanup(FILENAME, fapl_stdio);
|
||||
|
||||
/* CORE */
|
||||
MESSAGE(5, ("Testing File free space information for a core file\n"));
|
||||
@ -3223,6 +3229,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
|
||||
|
||||
ret = H5Fclose(file);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
|
||||
ret = H5Pclose(fapl);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
} /* end test_libver_bounds_real() */
|
||||
|
||||
/****************************************************************
|
||||
|
@ -111,6 +111,8 @@ test_h5o_open(void)
|
||||
CHECK(dspace, FAIL, "H5Dget_space");
|
||||
|
||||
/* Close the IDs */
|
||||
ret = H5Sclose(dspace);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
ret = H5Gclose(grp);
|
||||
CHECK(ret, FAIL, "H5Gclose");
|
||||
ret = H5Tclose(dtype);
|
||||
@ -324,6 +326,8 @@ test_h5o_open_by_addr(void)
|
||||
CHECK(dspace, FAIL, "H5Dget_space");
|
||||
|
||||
/* Close the IDs */
|
||||
ret = H5Sclose(dspace);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
ret = H5Gclose(grp);
|
||||
CHECK(ret, FAIL, "H5Gclose");
|
||||
ret = H5Tclose(dtype);
|
||||
|
11
test/th5s.c
11
test/th5s.c
@ -182,14 +182,13 @@ test_h5s_basic(void)
|
||||
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
CHECK_I(fid1, "H5Fopen");
|
||||
if (fid1 >= 0){
|
||||
dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT);
|
||||
VERIFY(dset1, FAIL, "H5Dopen2");
|
||||
ret = H5Fclose(fid1);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT);
|
||||
VERIFY(dset1, FAIL, "H5Dopen2");
|
||||
ret = H5Fclose(fid1);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
}
|
||||
else
|
||||
printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n",
|
||||
testfile);
|
||||
printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile);
|
||||
}
|
||||
|
||||
/* Verify that incorrect dimensions don't work */
|
||||
|
@ -3144,6 +3144,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id)
|
||||
/* Close the dataset and both files to make sure everything gets flushed
|
||||
* out of memory
|
||||
*/
|
||||
ret = H5Sclose(space_id);
|
||||
CHECK_I(ret, "H5Sclose");
|
||||
ret = H5Dclose(dset_id);
|
||||
CHECK_I(ret, "H5Dclose");
|
||||
ret = H5Fclose(src_file_id);
|
||||
@ -3201,6 +3203,9 @@ test_sohm_extlink(void)
|
||||
test_sohm_extlink_helper(fcpl_id, H5P_DEFAULT);
|
||||
test_sohm_extlink_helper(H5P_DEFAULT, fcpl_id);
|
||||
test_sohm_extlink_helper(fcpl_id, fcpl_id);
|
||||
|
||||
ret = H5Pclose(fcpl_id);
|
||||
CHECK_I(ret, "H5Pclose");
|
||||
}
|
||||
|
||||
|
||||
@ -3788,6 +3793,9 @@ test_sohm_extend_dset(void)
|
||||
CHECK_I(ret, "test_sohm_extend_dset_helper");
|
||||
ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
|
||||
CHECK_I(ret, "test_sohm_extend_dset_helper");
|
||||
|
||||
ret = H5Pclose(fcpl_id);
|
||||
CHECK_I(ret, "H5Pclose");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user