From 90ec386c958859b73bc050eafa7d525df9dd618c Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 12 Mar 2012 16:50:25 -0500 Subject: [svn-r22056] - fix several bugs in id management - update test cases that get the H5F_t struct to use H5I_object_verify instead of H5I_object because of the higher user level ID that is introduced - add some workarounds to take into consideration that the high level ID is not used everywhere at the moment - add a routine that translates from low level ids to high level ids --- src/H5F.c | 69 +++++++++++++++---- src/H5Fpkg.h | 2 +- src/H5I.c | 182 ++++++++++++++++++++++++++++++++------------------- src/H5Iprivate.h | 1 + src/H5VL.c | 2 +- src/H5VLnative.c | 37 +++++------ src/H5VLnative.h | 5 ++ test/accum.c | 2 +- test/btree2.c | 24 +++---- test/cache_tagging.c | 14 ++-- test/earray.c | 6 +- test/farray.c | 6 +- test/fheap.c | 140 +++++++++++++++++++-------------------- test/freespace.c | 32 ++++----- test/gheap.c | 12 ++-- test/lheap.c | 4 +- test/mf.c | 140 +++++++++++++++++++-------------------- test/mount.c | 4 +- test/ohdr.c | 8 +-- test/tfile.c | 26 ++++---- 20 files changed, 400 insertions(+), 316 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 459dbd8..2c16c65 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -323,7 +323,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver") if(H5P_set(new_plist, H5F_ACS_FILE_DRV_ID_NAME, &(f->shared->lf->driver_id)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file driver ID") -#if 0 +#if 1 /* Increment the reference count on the VOL ID and insert it into the property list */ if(H5I_inc_ref(f->vol_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VOL") @@ -1337,6 +1337,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") + /* Store the VOL id in the file struct */ + if(H5P_get(a_plist, H5F_ACS_VOL_ID_NAME, &(file->vol_id)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get vol plugin ID") + /* * Decide the file close degree. If it's the first time to open the * file, set the degree to access property list value; if it's the @@ -1440,15 +1444,6 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list") /* - * Adjust bit flags by turning on the creation bit and making sure that - * the EXCL or TRUNC bit is set. All newly-created files are opened for - * reading and writing. - */ - if (0==(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) - flags |= H5F_ACC_EXCL; /*default*/ - flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; - - /* * Create a new file or truncate an existing file. */ if((ret_value = H5VL_create(filename, flags, fcpl_id, fapl_id)) < 0) @@ -2022,13 +2017,26 @@ H5F_get_id(H5F_t *file, hbool_t app_ref) HDassert(file); if(file->file_id == -1) { + H5I_t *uid_info; /* user id structure */ /* Get an atom for the file */ if((file->file_id = H5I_register(H5I_FILE, file, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") + + /* Create a new id that points to a struct that holds the file id and the VOL id */ + if(NULL == (uid_info = H5FL_MALLOC(H5I_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + uid_info->obj_id = file->file_id; + uid_info->vol_id = file->vol_id; + if((H5I_register(H5I_UID, uid_info, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") } else { /* Increment reference count on atom. */ if(H5I_inc_ref(file->file_id, app_ref) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") + + /* Increment reference count on upper level ID. */ + if(H5I_inc_ref_uid(file->file_id, app_ref) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing user ID failed") } /* end else */ ret_value = file->file_id; @@ -2671,11 +2679,44 @@ H5Fget_name(hid_t uid, char *name/*out*/, size_t size) FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", uid, name, size); - argv[0] = &ret_value; - argv[1] = &size; - if(H5VL_get(uid, H5F_GET_NAME, (void *)name, 2, argv) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file name") + /* MSC - temp fix to handle later when all user level ids are of type UID */ + if (H5I_UID == H5I_get_type(uid)) { + argv[0] = &ret_value; + argv[1] = &size; + if(H5VL_get(uid, H5F_GET_NAME, (void *)name, 2, argv) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file name") + } + else { + H5F_t *f; /* Top file in mount hierarchy */ + size_t len; + /* For file IDs, get the file object directly */ + /* (This prevents the H5G_loc() call from returning the file pointer for + * the top file in a mount hierarchy) + */ + if(H5I_get_type(uid) == H5I_FILE ) { + if(NULL == (f = (H5F_t *)H5I_object(uid))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + } /* end if */ + else { + H5G_loc_t loc; /* Object location */ + + /* Get symbol table entry */ + if(H5G_loc(uid, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object ID") + f = loc.oloc->file; + } /* end else */ + len = HDstrlen(H5F_OPEN_NAME(f)); + + if(name) { + HDstrncpy(name, H5F_OPEN_NAME(f), MIN(len + 1,size)); + if(len >= size) + name[size-1]='\0'; + } /* end if */ + + /* Set return value */ + ret_value = (ssize_t)len; + } done: FUNC_LEAVE_API(ret_value) } /* end H5Fget_name() */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 5c6223b..bb6cc4e 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -274,7 +274,7 @@ struct H5F_t { hbool_t closing; /* File is in the process of being closed */ struct H5F_t *parent; /* Parent file that this file is mounted to */ unsigned nmounts; /* Number of children mounted to this file */ - //hid_t vol_id; /* id of the vol plugin used to open the file */ + hid_t vol_id; /* id of the vol plugin used to open the file */ //H5VL_class_t vol_cls; /* class of the VOL plugin */ }; diff --git a/src/H5I.c b/src/H5I.c index 3f6c2fd..ffdb21e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -978,18 +978,13 @@ done: *------------------------------------------------------------------------- */ void * -H5Iobject_verify(hid_t uid, H5I_type_t id_type) +H5Iobject_verify(hid_t id, H5I_type_t id_type) { - H5I_t *uid_info; /* user id structure */ - hid_t id; void * ret_value; /* Return value */ FUNC_ENTER_API(NULL) - /* Check arguments */ - if(uid < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - +#if 0 if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") @@ -998,6 +993,7 @@ H5Iobject_verify(hid_t uid, H5I_type_t id_type) else { id = uid; } +#endif if(H5I_IS_LIB_TYPE(id_type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") @@ -1031,12 +1027,19 @@ void * H5I_object_verify(hid_t id, H5I_type_t id_type) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ + H5I_t *uid_info; /* user id structure */ void *ret_value = NULL; /*return value */ FUNC_ENTER_NOAPI(NULL) HDassert(id_type >= 1 && id_type < H5I_next_type); + if (H5I_UID == H5I_get_type(id) && H5I_UID != id_type) { + if(NULL == (uid_info = (H5I_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") + id = uid_info->obj_id; + } + /* Verify that the type of the ID is correct & lookup the ID */ if(id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I_find_id(id))) { /* Get the object pointer to return */ @@ -1148,18 +1151,13 @@ done: *------------------------------------------------------------------------- */ void * -H5Iremove_verify(hid_t uid, H5I_type_t id_type) +H5Iremove_verify(hid_t id, H5I_type_t id_type) { - H5I_t *uid_info; /* user id structure */ - hid_t id; void * ret_value; /* Return value */ FUNC_ENTER_API(NULL) - /* Check arguments */ - if(uid < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - +#if 0 if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") @@ -1168,6 +1166,7 @@ H5Iremove_verify(hid_t uid, H5I_type_t id_type) else { id = uid; } +#endif if(H5I_IS_LIB_TYPE(id_type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") @@ -1305,7 +1304,6 @@ int H5Idec_ref(hid_t uid) { H5I_t *uid_info; /* user id structure */ - hid_t id; int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1318,20 +1316,18 @@ H5Idec_ref(hid_t uid) if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") - id = uid_info->obj_id; + + if((ret_value = H5I_dec_app_ref(uid_info->obj_id)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") + + if((ret_value = H5I_dec_app_ref(uid)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") } else { - id = uid; + /* Do actual decrement operation */ + if((ret_value = H5I_dec_app_ref(uid)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") } - - /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - - /* Do actual decrement operation */ - if((ret_value = H5I_dec_app_ref(id)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") - done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ @@ -1523,11 +1519,10 @@ int H5Iinc_ref(hid_t uid) { H5I_t *uid_info; /* user id structure */ - hid_t id; int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("Is", "i", id); + H5TRACE1("Is", "i", uid); /* Check arguments */ if(uid < 0) @@ -1536,19 +1531,20 @@ H5Iinc_ref(hid_t uid) if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") - id = uid_info->obj_id; + + if((ret_value = H5I_inc_ref(uid_info->obj_id, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") + + if((ret_value = H5I_inc_ref(uid, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") } else { - id = uid; + /* Do actual increment operation */ + if((ret_value = H5I_inc_ref(uid, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") } - /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - /* Do actual increment operation */ - if((ret_value = H5I_inc_ref(id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") done: FUNC_LEAVE_API(ret_value) @@ -1627,19 +1623,18 @@ done: *------------------------------------------------------------------------- */ int -H5Iget_ref(hid_t uid) +H5Iget_ref(hid_t id) { - H5I_t *uid_info; /* user id structure */ - hid_t id; int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("Is", "i", uid); + H5TRACE1("Is", "i", id); /* Check arguments */ - if(uid < 0) + if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") +#if 0 if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") @@ -1652,7 +1647,7 @@ H5Iget_ref(hid_t uid) /* Check arguments */ if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - +#endif /* Do actual retrieve operation */ if((ret_value = H5I_get_ref(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") @@ -1979,18 +1974,15 @@ done: *------------------------------------------------------------------------- */ htri_t -H5Iis_valid(hid_t uid) +H5Iis_valid(hid_t id) { H5I_id_info_t *id_ptr; /* ptr to the ID */ - H5I_t *uid_info; /* user id structure */ - hid_t id; htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("t", "i", uid); + H5TRACE1("t", "i", id); - id = uid; - /* +#if 0 if (H5I_UID == H5I_get_type(uid)) { if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") @@ -1999,10 +1991,7 @@ H5Iis_valid(hid_t uid) else { id = uid; } - - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") - */ +#endif /* Find the ID */ if (NULL == (id_ptr = H5I_find_id(id))) @@ -2091,8 +2080,8 @@ H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref) H5I_id_type_t *type_ptr; /*ptr to the type */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(NULL) - + FUNC_ENTER_NOAPI(NULL +) /* Check arguments */ if(type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") @@ -2274,15 +2263,12 @@ H5Iget_file_id(hid_t uid) else { id = uid; } - + if((ret_value = H5I_get_file_id(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID") - if (H5I_replace_with_uids (&ret_value, 1) <= 0) + if (H5I_replace_with_uids (&ret_value, 1) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID") - /* Increment reference count on atom. */ - if(H5I_inc_ref(ret_value, TRUE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") done: FUNC_LEAVE_API(ret_value) @@ -2318,6 +2304,10 @@ H5I_get_file_id(hid_t obj_id, hbool_t app_ref) if(H5I_inc_ref(obj_id, app_ref) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") + /* Increment reference count on upper level ID. */ + if(H5I_inc_ref_uid(obj_id, app_ref) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing user ID failed") + /* Set return value */ ret_value = obj_id; } /* end if */ @@ -2339,8 +2329,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_file_id() */ - - /*------------------------------------------------------------------------- * Function: H5I_replace_with_uids @@ -2356,7 +2344,7 @@ done: *------------------------------------------------------------------------- */ int -H5I_replace_with_uids(hid_t *oid_list, ssize_t num_ids) +H5I_replace_with_uids(hid_t *old_list, ssize_t num_ids) { ssize_t j; int ret_value = 0; /* Return value */ @@ -2364,11 +2352,13 @@ H5I_replace_with_uids(hid_t *oid_list, ssize_t num_ids) FUNC_ENTER_NOAPI(FAIL) for (j=0 ; jids > 0) { - H5I_id_info_t *id_ptr; /*ptr to the new ID */ + H5I_id_info_t *id_ptr; /*ptr to the new ID */ H5I_t *uid_info; /* user id structure */ - unsigned i; /*counter */ + unsigned i; /*counter */ /* Start at the beginning of the array */ for(i = 0; i < type_ptr->hash_size; i++) { @@ -2387,8 +2377,8 @@ H5I_replace_with_uids(hid_t *oid_list, ssize_t num_ids) while(id_ptr) { if(NULL == (uid_info = (H5I_t *)H5I_object(id_ptr->id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") - if (uid_info->obj_id == oid_list[j]) { - oid_list[j] = id_ptr->id; + if (uid_info->obj_id == old_list[j]) { + old_list[j] = id_ptr->id; ret_value ++; replaced = TRUE; break; @@ -2398,7 +2388,7 @@ H5I_replace_with_uids(hid_t *oid_list, ssize_t num_ids) if (replaced) break; } /* end for */ - } /* end if */ + } /* end if */ } done: FUNC_LEAVE_NOAPI(ret_value) @@ -2406,6 +2396,60 @@ done: /*------------------------------------------------------------------------- + * Function: H5I_inc_ref_uid + * + * Purpose: change the ids used by the HDF5 libraries to the UIDs that + * are provided to the user + * + * Return: How many IDs were replaced. + * + * Programmer: Mohamad Chaarawi + * Feb 2012 + * + *------------------------------------------------------------------------- + */ +int +H5I_inc_ref_uid(hid_t fid, hbool_t app_ref) +{ + H5I_id_type_t *type_ptr; /*ptr to the type */ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + type_ptr = H5I_id_type_list_g[H5I_UID]; + + if(type_ptr == NULL || type_ptr->count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + + /* Only iterate through hash table if there are IDs in group */ + if(type_ptr->ids > 0) { + H5I_id_info_t *id_ptr; /*ptr to the new ID */ + H5I_t *uid_info; /* user id structure */ + unsigned i; /*counter */ + + /* Start at the beginning of the array */ + for(i = 0; i < type_ptr->hash_size; i++) { + id_ptr = type_ptr->id_list[i]; + while(id_ptr) { + if(NULL == (uid_info = (H5I_t *)H5I_object(id_ptr->id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") + if (uid_info->obj_id == fid) { + /* Increment reference count on atom. */ + if((ret_value = H5I_inc_ref(id_ptr->id, app_ref)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") + HGOTO_DONE(ret_value) + } + id_ptr = id_ptr->next; + } /* end while */ + } /* end for */ + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_inc_ref_uid() */ + + +/*------------------------------------------------------------------------- * Function: H5I_debug * * Purpose: Dump the contents of a type to stderr for debugging. diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 6ffc3c9..bc2f354 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -81,5 +81,6 @@ H5_DLL int H5I_inc_type_ref(H5I_type_t type); H5_DLL herr_t H5I_dec_type_ref(H5I_type_t type); H5_DLL int H5I_get_type_ref(H5I_type_t type); H5_DLL herr_t H5I_replace_with_uids(hid_t *oid_list, ssize_t num_ids); +H5_DLL int H5I_inc_ref_uid(hid_t fid, hbool_t app_ref); #endif /* _H5Iprivate_H */ diff --git a/src/H5VL.c b/src/H5VL.c index 03eba8a..981fe68 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -692,7 +692,7 @@ H5VL_flush(hid_t uid, H5F_scope_t scope) /* Check/fix arguments. */ if(H5I_UID != H5I_get_type(uid)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") /* get the ID struct */ if(NULL == (uid_info = (H5I_t *)H5I_object(uid))) diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 08f62d3..e3b998a 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -46,12 +46,8 @@ static hid_t H5VL_NATIVE_g = 0; /* Prototypes */ -static hid_t H5VL_native_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id); -static herr_t H5VL_native_close(hid_t fid); -static hid_t H5VL_native_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); -static herr_t H5VL_native_flush(hid_t fid, H5F_scope_t scope); -static herr_t H5VL_native_get(hid_t file_id, H5VL_file_get_t get_type, void *data, int argc, void **argv); +static herr_t H5VL_native_get(hid_t file_id, H5VL_file_get_t get_type, + void *data, int argc, void **argv); static herr_t H5VL_native_term(void); static const H5VL_class_t H5VL_native_g = { @@ -226,7 +222,7 @@ done: * *------------------------------------------------------------------------- */ -static hid_t +hid_t H5VL_native_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id) { @@ -273,7 +269,7 @@ done: * *------------------------------------------------------------------------- */ -static hid_t +hid_t H5VL_native_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *new_file; /* file struct */ @@ -281,6 +277,15 @@ H5VL_native_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_i FUNC_ENTER_NOAPI_NOINIT + /* + * Adjust bit flags by turning on the creation bit and making sure that + * the EXCL or TRUNC bit is set. All newly-created files are opened for + * reading and writing. + */ + if (0==(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) + flags |= H5F_ACC_EXCL; /*default*/ + flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; + /* Create the file */ if(NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") @@ -313,7 +318,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5VL_native_close(hid_t file_id) { int nref; @@ -367,7 +372,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5VL_native_flush(hid_t object_id, H5F_scope_t scope) { H5F_t *f = NULL; /* File to flush */ @@ -461,7 +466,7 @@ H5VL_native_flush(hid_t object_id, H5F_scope_t scope) /* Call the flush routine for mounted file hierarchies */ if(H5F_flush_mounts(f, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") - } /* end if */ + } /* end if */ else { /* Call the flush routine, for this file */ if(H5F_flush(f, H5AC_dxpl_id, FALSE) < 0) @@ -633,16 +638,6 @@ H5VL_native_get(hid_t obj_id, H5VL_file_get_t get_type, void *data, int argc, vo ret = (ssize_t)len; break; } - /* H5Fget_ */ - case H5F_GET_OBJ_COUNT: - { - break; - } - /* H5Fget_create_plist */ - case H5F_GET_OBJ_IDS: - { - break; - } /* H5Fget_vfd_handle */ case H5F_GET_VFD_HANDLE: { diff --git a/src/H5VLnative.h b/src/H5VLnative.h index 36177ed..ab4dd20 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -30,6 +30,11 @@ extern "C" { H5_DLL hid_t H5VL_native_init(void); H5_DLL herr_t H5Pset_fapl_native(hid_t fapl_id); +H5_DLL hid_t H5VL_native_open(const char *name, unsigned flags, hid_t fcpl_id, + hid_t fapl_id, hid_t dxpl_id); +H5_DLL herr_t H5VL_native_close(hid_t fid); +H5_DLL hid_t H5VL_native_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); +H5_DLL herr_t H5VL_native_flush(hid_t fid, H5F_scope_t scope); #ifdef __cplusplus } diff --git a/test/accum.c b/test/accum.c index c5f6610..11d44d4 100644 --- a/test/accum.c +++ b/test/accum.c @@ -92,7 +92,7 @@ main(void) if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get H5F_t * to internal file structure */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR + if(NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE))) FAIL_STACK_ERROR /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ diff --git a/test/btree2.c b/test/btree2.c index d8abc84..131f9cb 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -104,7 +104,7 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2806,7 +2806,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2845,7 +2845,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6375,7 +6375,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6531,7 +6531,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6627,7 +6627,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6716,7 +6716,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6802,7 +6802,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7153,7 +7153,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7198,7 +7198,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7256,7 +7256,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7314,7 +7314,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 9aef651..a133daa 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -237,7 +237,7 @@ static int print_index(hid_t fid) { H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; cache_ptr = f->shared->cache; /* Initial (debugging) loop */ @@ -294,7 +294,7 @@ static int verify_no_unknown_tags(hid_t fid) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -346,7 +346,7 @@ static int mark_all_entries_investigated(hid_t fid) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -403,7 +403,7 @@ static int verify_tag(hid_t fid, int id, haddr_t tag) H5C_cache_entry_t *next_entry_ptr = NULL; /* entry pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -448,7 +448,7 @@ static int evict_entries(hid_t fid) H5F_t * f = NULL; /* File Pointer */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; /* Mark all entries investigated */ mark_all_entries_investigated(fid); @@ -493,7 +493,7 @@ static int get_new_object_header_tag(hid_t fid, haddr_t *tag) int found = FALSE; /* If entry is found */ /* Get Internal File / Cache Pointers */ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; cache_ptr = f->shared->cache; for (i = 0; i < H5C__HASH_TABLE_LEN; i++) { @@ -3831,7 +3831,7 @@ check_invalid_tag_application(void) if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* Get internal file pointer*/ - if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; + if ( NULL == (f = (H5F_t *)H5I_object_verify(fid, H5I_FILE)) ) TEST_ERROR; /* Create dxpl */ if ( (dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; diff --git a/test/earray.c b/test/earray.c index 132913b..aef4b59 100644 --- a/test/earray.c +++ b/test/earray.c @@ -319,7 +319,7 @@ create_file(hid_t fapl, hid_t *file, H5F_t **f) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -451,7 +451,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1156,7 +1156,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5I_object_verify(file2, H5I_FILE))) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ diff --git a/test/farray.c b/test/farray.c index 2844a5d..0e444d8 100644 --- a/test/farray.c +++ b/test/farray.c @@ -155,7 +155,7 @@ create_file(hid_t fapl, hid_t *file, H5F_t **f) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -291,7 +291,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -675,7 +675,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5I_object_verify(file2, H5I_FILE))) FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ diff --git a/test/fheap.c b/test/fheap.c index 2cb8796..f2960a3 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -589,7 +589,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -640,7 +640,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Check for deleting the entire heap */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -682,7 +682,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5I_object_verify(*file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1852,7 +1852,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -1969,7 +1969,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2012,7 +2012,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2118,7 +2118,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2170,7 +2170,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5I_object_verify(file2, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2288,7 +2288,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2361,7 +2361,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2447,7 +2447,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2790,7 +2790,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2833,7 +2833,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2913,7 +2913,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -2967,7 +2967,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3056,7 +3056,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file1))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file1, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3100,7 +3100,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object (file1) */ - if(NULL == (f = (H5F_t *)H5I_object(file1))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file1, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3122,7 +3122,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) /* Get a pointer to the internal file object (file2) */ - if(NULL == (f = (H5F_t *)H5I_object(file2))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file2, H5I_FILE))) FAIL_STACK_ERROR /* Reopen the heap */ @@ -3195,7 +3195,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3305,7 +3305,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3406,7 +3406,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3503,7 +3503,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3602,7 +3602,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3708,7 +3708,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3815,7 +3815,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -3926,7 +3926,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4022,7 +4022,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4125,7 +4125,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4226,7 +4226,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4337,7 +4337,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4434,7 +4434,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4530,7 +4530,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4632,7 +4632,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4742,7 +4742,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4845,7 +4845,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -4956,7 +4956,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5064,7 +5064,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Create absolute heap */ @@ -5162,7 +5162,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5271,7 +5271,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5374,7 +5374,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5484,7 +5484,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5595,7 +5595,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5702,7 +5702,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5810,7 +5810,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -5925,7 +5925,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6045,7 +6045,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6157,7 +6157,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6272,7 +6272,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6406,7 +6406,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6559,7 +6559,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6600,7 +6600,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6723,7 +6723,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6764,7 +6764,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6916,7 +6916,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -6957,7 +6957,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7085,7 +7085,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7126,7 +7126,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7329,7 +7329,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -7370,7 +7370,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -13720,7 +13720,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -14900,7 +14900,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15086,7 +15086,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15150,7 +15150,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15186,7 +15186,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15223,7 +15223,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15259,7 +15259,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15900,7 +15900,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -15967,7 +15967,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16132,7 +16132,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -16162,7 +16162,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ diff --git a/test/freespace.c b/test/freespace.c index 6960e6d..3beec76 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -480,7 +480,7 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* initialize creation parameters for free-space manager */ @@ -619,7 +619,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -680,7 +680,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -750,7 +750,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -819,7 +819,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -940,7 +940,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1324,7 +1324,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1451,7 +1451,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1551,7 +1551,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1786,7 +1786,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1885,7 +1885,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1985,7 +1985,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2122,7 +2122,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2228,7 +2228,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2410,7 +2410,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* @@ -2761,7 +2761,7 @@ test_fs_sect_iterate(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR init_cparam(&cparam); diff --git a/test/gheap.c b/test/gheap.c index f30935a..d04c8ff 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -92,7 +92,7 @@ test_1 (hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -187,7 +187,7 @@ test_2 (hid_t fapl) h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -274,7 +274,7 @@ test_3 (hid_t fapl) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -353,7 +353,7 @@ test_4 (hid_t fapl) h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -440,7 +440,7 @@ test_ooo_indices(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to create file"); goto error; @@ -481,7 +481,7 @@ test_ooo_indices(hid_t fapl) if (H5Fclose(file)<0) goto error; if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); puts(" Unable to open file"); goto error; diff --git a/test/lheap.c b/test/lheap.c index 51ae25b..277c3da 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -79,7 +79,7 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -127,7 +127,7 @@ main(void) TESTING("local heap read"); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) goto error; - if(NULL == (f = (H5F_t *)H5I_object(file))) { + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; diff --git a/test/mf.c b/test/mf.c index 3b1a8d8..5d1343b 100644 --- a/test/mf.c +++ b/test/mf.c @@ -221,7 +221,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -263,7 +263,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30); @@ -364,7 +364,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -396,7 +396,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -441,7 +441,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -490,7 +490,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -533,7 +533,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -643,7 +643,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -674,7 +674,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* should succeed */ @@ -721,7 +721,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -840,7 +840,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Retrieve the file's maxaddr */ @@ -894,7 +894,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 1/3 of the file as temporary address space */ @@ -1001,7 +1001,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Start up free-space manager */ @@ -1115,7 +1115,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1201,7 +1201,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1285,7 +1285,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1466,7 +1466,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1583,7 +1583,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1695,7 +1695,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1807,7 +1807,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1994,7 +1994,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2063,7 +2063,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2191,7 +2191,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2227,7 +2227,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Free the two blocks */ @@ -2322,7 +2322,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -2368,7 +2368,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50+TEST_BLOCK_SIZE2058); @@ -2476,7 +2476,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2637,7 +2637,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2783,7 +2783,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2915,7 +2915,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -3080,7 +3080,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3236,7 +3236,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3300,7 +3300,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -3370,7 +3370,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -3499,7 +3499,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3546,7 +3546,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3605,7 +3605,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3752,7 +3752,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -3834,7 +3834,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* allocate a block of 50 from meta_aggr */ @@ -3856,7 +3856,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* shrink the block */ @@ -3889,7 +3889,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* allocate a block of 50 */ @@ -3911,7 +3911,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* try to extend the block */ @@ -4011,7 +4011,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4080,7 +4080,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4169,7 +4169,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -4393,7 +4393,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -4650,7 +4650,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -4979,7 +4979,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -5271,7 +5271,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5478,7 +5478,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5747,7 +5747,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5920,7 +5920,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -5954,7 +5954,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -5996,7 +5996,7 @@ test_mf_fs_persist(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6046,7 +6046,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 4 blocks */ @@ -6080,7 +6080,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ @@ -6099,7 +6099,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6133,7 +6133,7 @@ test_mf_fs_gone(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ @@ -6181,7 +6181,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ @@ -6226,7 +6226,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6310,7 +6310,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_DRAW is not there */ @@ -6354,7 +6354,7 @@ test_mf_fs_split(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6416,7 +6416,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ @@ -6461,7 +6461,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6543,7 +6543,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_SUPER is there */ @@ -6609,7 +6609,7 @@ test_mf_fs_multi(hid_t fapl_new, hid_t fcpl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */ @@ -6874,7 +6874,7 @@ test_filespace_strategy_threshold(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -6918,7 +6918,7 @@ test_filespace_strategy_threshold(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR switch(fs_type) { @@ -7026,7 +7026,7 @@ test_filespace_gone(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* Allocate 6 blocks */ @@ -7094,7 +7094,7 @@ test_filespace_gone(hid_t fapl_new) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR /* free-space manager should be empty */ diff --git a/test/mount.c b/test/mount.c index b7180fa..2b6e44f 100644 --- a/test/mount.c +++ b/test/mount.c @@ -2691,7 +2691,7 @@ test_acc_perm(hid_t fapl) if((gidAMZ = H5Gcreate2(fid1, "/A/M/Z", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - /* Get and verify file name */ + /* get and verify file name */ if(H5Fget_name(gidAMZ, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename3) != 0) @@ -4286,7 +4286,6 @@ test_multisharedclose(hid_t fapl) if (H5Idec_ref(fid2) < 0) TEST_ERROR if (H5Idec_ref(fid1) < 0) TEST_ERROR - /* Open master and child 2 and mount child 2 to master */ if ((fid1 = H5Fopen(filename4, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR if ((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4312,7 +4311,6 @@ test_multisharedclose(hid_t fapl) if (H5Idec_ref(fid2) < 0) TEST_ERROR if (H5Idec_ref(fid1) < 0) TEST_ERROR - /* Close gid1. This will close child 1. */ if (H5Idec_ref(gid1) < 0) TEST_ERROR diff --git a/test/ohdr.c b/test/ohdr.c index 502a8b1..8c1a4b1 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -73,7 +73,7 @@ test_cont(char *filename, hid_t fapl) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -200,7 +200,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR if(H5Pclose(my_fapl) < 0) FAIL_STACK_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR if(H5AC_ignore_tags(f) < 0) FAIL_STACK_ERROR @@ -348,7 +348,7 @@ main(void) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { H5_FAILED(); @@ -449,7 +449,7 @@ main(void) FAIL_STACK_ERROR if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object_verify(file, H5I_FILE))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) FAIL_STACK_ERROR diff --git a/test/tfile.c b/test/tfile.c index 68801f2..ed33c91 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -989,7 +989,7 @@ test_get_file_id(void) //printf ("REF COUNT = %d\n", H5I_get_ref (fid, FALSE)); /* Test H5Iget_file_id() */ - //MSC - check_file_id(-1, group_id); + check_file_id(-1, group_id); ret = H5Gclose(group_id); CHECK(ret, FAIL, "H5Gclose"); @@ -1765,9 +1765,9 @@ test_file_getname(void) CHECK(group_id, FAIL, "H5Gcreate2"); /* Get and verify file name */ - //MSC - name_len = H5Fget_name(group_id, name, (size_t)TESTA_NAME_BUF_SIZE); - //MSC - CHECK(name_len, FAIL, "H5Fget_name"); - //MSC - VERIFY_STR(name, FILE1, "H5Fget_name"); + name_len = H5Fget_name(group_id, name, (size_t)TESTA_NAME_BUF_SIZE); + CHECK(name_len, FAIL, "H5Fget_name"); + VERIFY_STR(name, FILE1, "H5Fget_name"); /* Create the data space */ space_id = H5Screate_simple(TESTA_RANK, dims, NULL); @@ -1785,18 +1785,18 @@ test_file_getname(void) CHECK(dataset_id, FAIL, "H5Dcreate2"); /* Get and verify file name */ - //MSC - name_len = H5Fget_name(dataset_id, name, (size_t)TESTA_NAME_BUF_SIZE); - //MSC - CHECK(name_len, FAIL, "H5Fget_name"); - //MSC - VERIFY_STR(name, FILE1, "H5Fget_name"); + name_len = H5Fget_name(dataset_id, name, (size_t)TESTA_NAME_BUF_SIZE); + CHECK(name_len, FAIL, "H5Fget_name"); + VERIFY_STR(name, FILE1, "H5Fget_name"); /* Create an attribute for the dataset */ attr_id = H5Acreate2(dataset_id, TESTA_ATTRNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Acreate2"); /* Get and verify file name */ - //MSC - name_len = H5Fget_name(attr_id, name, (size_t)TESTA_NAME_BUF_SIZE); - //MSC - CHECK(name_len, FAIL, "H5Fget_name"); - //MSC - VERIFY_STR(name, FILE1, "H5Fget_name"); + name_len = H5Fget_name(attr_id, name, (size_t)TESTA_NAME_BUF_SIZE); + CHECK(name_len, FAIL, "H5Fget_name"); + VERIFY_STR(name, FILE1, "H5Fget_name"); /* Create a compound datatype */ type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); @@ -1814,9 +1814,9 @@ test_file_getname(void) CHECK(ret, FAIL, "H5Tcommit2"); /* Get and verify file name */ - //MSC - name_len = H5Fget_name(type_id, name, (size_t)TESTA_NAME_BUF_SIZE); - //MSC - CHECK(name_len, FAIL, "H5Fget_name"); - //MSC - VERIFY_STR(name, FILE1, "H5Fget_name"); + name_len = H5Fget_name(type_id, name, (size_t)TESTA_NAME_BUF_SIZE); + CHECK(name_len, FAIL, "H5Fget_name"); + VERIFY_STR(name, FILE1, "H5Fget_name"); /* Close things down */ ret = H5Tclose(type_id); -- cgit v0.12