diff options
Diffstat (limited to 'test/tfile.c')
-rw-r--r-- | test/tfile.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/test/tfile.c b/test/tfile.c index 797b4fa..dfdbf25 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -709,7 +709,6 @@ test_file_close(void) ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - /* Test behavior while opening file multiple times with file close * degree WEAK */ ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK); @@ -760,7 +759,6 @@ test_file_close(void) ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); - /* Test behavior while opening file multiple times with file close * degree DEFAULT */ ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT); @@ -1112,13 +1110,14 @@ test_get_file_id(void) */ group_id = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group_id, FAIL, "H5Gcreate2"); - + /* Test H5Iget_file_id() */ check_file_id(fid, group_id); /* Close the file and get file ID from the group ID */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); + //printf ("REF COUNT = %d\n", H5I_get_ref (fid, FALSE)); /* Test H5Iget_file_id() */ check_file_id(-1, group_id); @@ -1230,7 +1229,6 @@ check_file_id(hid_t fid, hid_t object_id) * And close this duplicated ID */ new_fid = H5Iget_file_id(object_id); - if(fid >=0) VERIFY(new_fid, fid, "H5Iget_file_id"); else @@ -1259,7 +1257,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, fid4 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid4, FAIL, "H5Fcreate"); - /* test object count of all files IDs open */ + /* test object count of all files open */ oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count"); @@ -1288,7 +1286,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); - + if(oid_count > 0) { hid_t *oid_list; @@ -1306,13 +1304,13 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, switch(id_type) { case H5I_FILE: if(oid_list[i] != fid1 && oid_list[i] != fid2 - && oid_list[i] != fid3 && oid_list[i] != fid4) + && oid_list[i] != fid3 && oid_list[i] != fid4) ERROR("H5Fget_obj_ids"); break; case H5I_GROUP: if(oid_list[i] != gid1 && oid_list[i] != gid2 - && oid_list[i] != gid3) + && oid_list[i] != gid3) ERROR("H5Fget_obj_ids"); break; @@ -1324,7 +1322,6 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, ERROR("H5Fget_obj_ids"); } /* end switch */ } /* end for */ - HDfree(oid_list); } /* end if */ } /* end if */ @@ -1579,13 +1576,13 @@ test_file_freespace(void) /**************************************************************** ** -** test_file_ishdf5(): low-level file test routine. -** This test checks whether the H5Fis_hdf5() routine is working +** test_file_isaccessible(): low-level file test routine. +** This test checks whether the H5Fis_accessible() routine is working ** correctly in variuous situations. ** *****************************************************************/ static void -test_file_ishdf5(void) +test_file_isaccessible(void) { hid_t file; /* File opened with read-write permission */ hid_t fcpl; /* File creation property list */ @@ -1608,8 +1605,8 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "H5Fclose"); /* Verify that the file is an HDF5 file */ - status = H5Fis_hdf5(FILE1); - VERIFY(status, TRUE, "H5Fis_hdf5"); + status = H5Fis_accessible(FILE1, H5P_DEFAULT); + VERIFY(status, TRUE, "H5Fis_accessible"); /* Create a file creation property list with a non-default user block size */ @@ -1632,8 +1629,8 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "H5Fclose"); /* Verify that the file is an HDF5 file */ - status = H5Fis_hdf5(FILE1); - VERIFY(status, TRUE, "H5Fis_hdf5"); + status = H5Fis_accessible(FILE1, H5P_DEFAULT); + VERIFY(status, TRUE, "H5Fis_accessible"); /* Create non-HDF5 file and check it */ @@ -1653,10 +1650,10 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "HDclose"); /* Verify that the file is not an HDF5 file */ - status = H5Fis_hdf5(FILE1); - VERIFY(status, FALSE, "H5Fis_hdf5"); + status = H5Fis_accessible(FILE1, H5P_DEFAULT); + VERIFY(status, FALSE, "H5Fis_accessible"); -} /* end test_file_ishdf5() */ +} /* end test_file_isaccessible() */ /**************************************************************** ** @@ -3660,7 +3657,7 @@ test_file(void) test_file_perm(); /* Test file access permissions */ test_file_perm2(); /* Test file access permission again */ test_file_freespace(); /* Test file free space information */ - test_file_ishdf5(); /* Test detecting HDF5 files correctly */ + test_file_isaccessible(); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ #ifndef H5_CANNOT_OPEN_TWICE test_file_open_overlap(); /* Test opening files in an overlapping manner */ |