summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2019-05-13 16:34:51 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2019-05-13 16:34:51 (GMT)
commit1d87374f68a28a215878a47e1203711dc95ac716 (patch)
tree55ae663f4f1a49b786d13c91cca9330584b42335
parent1f934ae2c6e13ca020e489efa0447bc8cc74db09 (diff)
parent4dfcc225ba98a5ad1bc4283b8eacde0bb6f7484c (diff)
downloadhdf5-1d87374f68a28a215878a47e1203711dc95ac716.zip
hdf5-1d87374f68a28a215878a47e1203711dc95ac716.tar.gz
hdf5-1d87374f68a28a215878a47e1203711dc95ac716.tar.bz2
Merge pull request #4 in ~VCHOI/my_third_fork from hdf5_1_10 to bugfix/v110_HDFFV-10365-h5sencode-decode-bug-when-num
* commit '4dfcc225ba98a5ad1bc4283b8eacde0bb6f7484c': Fix Java JUnit-TestH5P failure on 32-bit arch Added new C++ wrappers - HDFFV-10622 Make the corresponding fix for HDFFV-10579 H5Arename fails when creation order of attributes is tracked.
-rw-r--r--c++/src/H5LcreatProp.cpp40
-rw-r--r--c++/src/H5LcreatProp.h8
-rw-r--r--c++/src/H5Location.cpp7
-rw-r--r--c++/test/tobject.cpp128
-rw-r--r--java/src/jni/h5pFCPLImp.c2
-rw-r--r--release_docs/RELEASE.txt10
-rw-r--r--src/H5Adense.c30
-rw-r--r--test/tattr.c107
8 files changed, 274 insertions, 58 deletions
diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp
index 695c1fe..bde9339 100644
--- a/c++/src/H5LcreatProp.cpp
+++ b/c++/src/H5LcreatProp.cpp
@@ -103,6 +103,46 @@ LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList& original) : PropLi
LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
+// Function: LinkCreatPropList::setCreateIntermediateGroup
+///\brief Specifies in property list whether to create missing
+/// intermediate groups.
+///\param crt_intmd_group - IN: Flag specifying whether to create
+/// intermediate groups upon the creation of an object
+///\exception H5::PropListIException
+// April, 2019
+//--------------------------------------------------------------------------
+void LinkCreatPropList::setCreateIntermediateGroup(bool crt_intmd_group) const
+{
+ herr_t ret_value = H5Pset_create_intermediate_group(id, (unsigned)crt_intmd_group);
+ // Throw exception if H5Pset_create_intermediate_group returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("setCreateIntermediateGroup", "H5Pset_create_intermediate_group failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: LinkCreatPropList::getCreateIntermediateGroup
+///\brief Determines whether property is set to enable creating missing
+/// intermediate groups.
+///\return true if creating intermediate groups is enabled, and false, otherwise
+///\exception H5::PropListIException
+// April, 2019
+//--------------------------------------------------------------------------
+bool LinkCreatPropList::getCreateIntermediateGroup() const
+{
+ unsigned crt_intmd_group;
+ herr_t ret_value = H5Pget_create_intermediate_group(id, &crt_intmd_group);
+ // Throw exception if H5Pget_create_intermediate_group returns failure
+ if (ret_value < 0)
+ {
+ throw PropListIException("getCreateIntermediateGroup", "H5Pget_create_intermediate_group failed");
+ }
+
+ return((bool)crt_intmd_group);
+}
+
+//--------------------------------------------------------------------------
// Function: LinkCreatPropList::setCharEncoding
///\brief Sets the character encoding of the string.
///
diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h
index f6e10bf..908ef63 100644
--- a/c++/src/H5LcreatProp.h
+++ b/c++/src/H5LcreatProp.h
@@ -40,6 +40,14 @@ class H5_DLLCPP LinkCreatPropList : public PropList {
// using the property list id.
LinkCreatPropList (const hid_t plist_id);
+ // Specifies in property list whether to create missing
+ // intermediate groups
+ void setCreateIntermediateGroup(bool crt_intmd_group) const;
+
+ // Determines whether property is set to enable creating missing
+ // intermediate groups
+ bool getCreateIntermediateGroup() const;
+
// Sets the character encoding of the string.
void setCharEncoding(H5T_cset_t encoding) const;
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 2c49016..2641960 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -1066,7 +1066,7 @@ void H5Location::link(const char *curr_name, const Group& new_loc,
hid_t lcpl_id = lcpl.getId();
hid_t lapl_id = lapl.getId();
- ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, H5P_DEFAULT, H5P_DEFAULT);
+ ret_value = H5Lcreate_hard(getId(), curr_name, new_loc_id, new_name, lcpl_id, lapl_id);
if (ret_value < 0)
throwException("link", "creating link failed");
}
@@ -1102,14 +1102,13 @@ void H5Location::link(const H5std_string& curr_name, const Group& new_loc,
/// H5Lcreate_hard APIs in the HDF5 C Reference Manual.
// March 2018
//--------------------------------------------------------------------------
-void H5Location::link(const char *curr_name, const hid_t same_loc,
- const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const
+void H5Location::link(const char *curr_name, const hid_t same_loc, const char *new_name, const LinkCreatPropList& lcpl, const LinkAccPropList& lapl) const
{
herr_t ret_value = -1;
hid_t lcpl_id = lcpl.getId();
hid_t lapl_id = lapl.getId();
- ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, H5P_DEFAULT, H5P_DEFAULT);
+ ret_value = H5Lcreate_hard(getId(), curr_name, same_loc, new_name, lcpl_id, lapl_id);
if (ret_value < 0)
throwException("link", "creating link failed");
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index 537716f..232ece2 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -609,10 +609,121 @@ static void test_getobjectinfo_same_file()
catch (Exception& E)
{
cerr << " in Exception " << E.getCFuncName() << "detail: " << E.getCDetailMsg() << endl;
- issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg());
+ issue_fail_msg("test_getobjectinfo_same_file()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+
+} // test_getobjectinfo_same_file
+
+/*-------------------------------------------------------------------------
+ * Function: test_intermediate_groups
+ *
+ * Purpose Test that intermediate groups are created as specified by
+ * the property setting.
+ *
+ * Return None
+ *
+ * April, 2019
+ *-------------------------------------------------------------------------
+ */
+const H5std_string FILE_INTERGRPS("tobject_intergrps.h5");
+const H5std_string GROUP10NAME("/group10");
+const H5std_string GROUP11NAME("/group10/group11");
+const H5std_string GROUP12NAME("/group10/group11/group12");
+const H5std_string GROUP13NAME("/group10/group11/group12/group13");
+const H5std_string GROUP14NAME("/group10/group11/group12/group13/group14");
+const H5std_string GROUP14FROM13NAME("group14");
+const H5std_string GROUP20NAME("/group20");
+const H5std_string GROUP21NAME("/group20/group21");
+const H5std_string GROUP22NAME("group21/group22");
+const H5std_string GROUP22FULLNAME("/group20/group21/group22");
+static void test_intermediate_groups()
+{
+ // Output message about test being performed
+ SUBTEST("Group::set/getCreateIntermediateGroup");
+
+ try {
+ // Create a new HDF5 file
+ H5File file(FILE_INTERGRPS, H5F_ACC_TRUNC);
+
+ // Create a link create property list and set the "create
+ // intermediate groups" flag
+ LinkCreatPropList lcpl;
+ lcpl.setCreateIntermediateGroup(true);
+
+ // Verify value of create missing groups flag
+ bool crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, true, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+ // Create GROUP12NAME with creating missing groups
+ Group grp12(file.createGroup(GROUP12NAME, lcpl));
+
+ // Missing groups: GROUP10NAME and GROUP11NAME
+
+ // Create GROUP14NAME without the use of link create plist, should
+ // fail because group GROUP13NAME is missing
+ try {
+ Group grp14_nopl(file.createGroup(GROUP14NAME));
+ } catch (FileIException& expected1) {} // Failure is ignored
+
+ // Create GROUP14NAME with the flag to create missing groups set
+ // to FALSE, should fail because group GROUP13NAME is missing
+
+ // Reset flag to not create missing groups
+ lcpl.setCreateIntermediateGroup(false);
+
+ // Verify value of create missing groups flag
+ crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, false, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+ try {
+ Group grp14_false(file.createGroup(GROUP14NAME, lcpl));
+ } catch (FileIException& expected2) {} // Failure is ignored
+
+ // Set the flag to create missing groups set to TRUE
+ lcpl.setCreateIntermediateGroup(true);
+ crt_int_grps = lcpl.getCreateIntermediateGroup();
+ verify_val(crt_int_grps, true, "LinkCreatPropList::getCreateIntermediateGroup", __LINE__, __FILE__);
+
+
+ // Create GROUP14NAME with the use of link create plist
+ Group grp14(file.createGroup(GROUP14NAME, lcpl));
+
+ // Missing groups: GROUP13NAME
+
+ // Create group GROUP20NAME
+ Group grp20(file.createGroup(GROUP20NAME));
+
+ // Create group GROUP22NAME with missing group GROUP21NAME
+ Group grp22(grp20.createGroup(GROUP22NAME, lcpl));
+
+ // Close groups and file
+ grp12.close();
+ grp14.close();
+ grp20.close();
+ grp22.close();
+ file.close();
+
+ // Reopen the file
+ file.openFile(FILE_INTERGRPS, H5F_ACC_RDWR);
+
+ // Open the missing groups and various combinations
+ Group grp10(file.openGroup(GROUP10NAME));
+ Group grp11(file.openGroup(GROUP11NAME));
+ Group grp13(file.openGroup(GROUP13NAME));
+ Group grp14from13(grp13.openGroup(GROUP14FROM13NAME));
+ Group grp21(file.openGroup(GROUP21NAME));
+ Group grp22fromfile(file.openGroup(GROUP22FULLNAME));
+
+ PASSED();
+ } // end of try block
+ // catch all other exceptions
+ catch (Exception& E)
+ {
+ cerr << " in Exception " << E.getCFuncName() << "detail: " << E.getCDetailMsg() << endl;
+ issue_fail_msg("test_intermediate_groups()", __LINE__, __FILE__, E.getCDetailMsg());
}
-} // test_h5o_getinfo_same_file
+} // test_intermediate_groups
/*-------------------------------------------------------------------------
* Function: test_object
@@ -631,12 +742,13 @@ void test_object()
// Output message about test being performed
MESSAGE(5, ("Testing Object Functions\n"));
- test_get_objname(); // Test get object name from groups/datasets
- test_existance(); // Test check for object existance
- test_get_objname_ontypes(); // Test get object name from types
- test_get_objtype(); // Test get object type
- test_open_object_header(); // Test object header functions (H5O)
- test_getobjectinfo_same_file(); // Test object info in same file
+ test_get_objname(); // Test get object name from groups/datasets
+ test_existance(); // Test check for object existance
+ test_get_objname_ontypes(); // Test get object name from types
+ test_get_objtype(); // Test get object type
+ test_open_object_header(); // Test object header functions (H5O)
+ test_getobjectinfo_same_file(); // Test object info in same file
+ test_intermediate_groups(); // Test intermediate group property
} // test_object
diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c
index 34ac065..cc7c264 100644
--- a/java/src/jni/h5pFCPLImp.c
+++ b/java/src/jni/h5pFCPLImp.c
@@ -240,7 +240,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1sym_1k
done:
if (theArray)
- UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
+ UNPIN_INT_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1sym_1k */
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index ce8b8a5..a3f2232 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -247,6 +247,12 @@ New Features
C++ Library:
------------
+ - Added new wrappers for H5Pset/get_create_intermediate_group()
+ LinkCreatPropList::setCreateIntermediateGroup()
+ LinkCreatPropList::getCreateIntermediateGroup()
+
+ (BMR - 2019/04/22, HDFFV-10622)
+
- Added new function to the C++ interface
Added wrapper for H5Ovisit2:
@@ -257,6 +263,10 @@ New Features
Java Library:
----------------
+ - Fix a failure in JUnit-TestH5P on 32-bit architectures
+
+ (JTH - 2019/04/30)
+
- Rewrote the JNI error handling to be much cleaner
(JTH - 2019/02/12)
diff --git a/src/H5Adense.c b/src/H5Adense.c
index 40a7a9a..c6aa8e0 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -915,6 +915,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name,
H5HF_t *fheap = NULL; /* Fractal heap handle */
H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */
H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */
+ H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order ndex */
H5A_t *attr_copy = NULL; /* Copy of attribute to rename */
htri_t attr_sharable; /* Flag indicating attributes are sharable */
htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */
@@ -994,6 +995,33 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name,
if(H5A__set_version(f, attr_copy) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "unable to update attribute version")
+ /* Need to remove the attribute from the creation order index v2 B-tree */
+ if(ainfo->index_corder) {
+ htri_t corder_attr_exists; /* Attribute exists in v2 B-tree */
+
+ /* Open the creation order index v2 B-tree */
+ HDassert(H5F_addr_defined(ainfo->corder_bt2_addr));
+ if(NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL)))
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation index")
+
+ /* Set up the creation order to search for */
+ udata.corder = attr_copy->shared->crt_idx;
+
+ if((corder_attr_exists = H5B2_find(bt2_corder, &udata, NULL, NULL)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index")
+
+ if(corder_attr_exists) {
+ H5A_bt2_ud_rm_t rm_udata;
+
+ /* Set up the creation order in user data for the v2 B-tree 'record remove' callback */
+ rm_udata.common.corder = attr_copy->shared->crt_idx;
+
+ /* Remove the record from the creation order index v2 B-tree */
+ if(H5B2_remove(bt2_corder, &rm_udata, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from creation order index v2 B-tree")
+ }
+ }
+
/* Insert renamed attribute back into dense storage */
/* (Possibly making it shared) */
if(H5A__dense_insert(f, ainfo, attr_copy) < 0)
@@ -1041,6 +1069,8 @@ done:
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap")
if(bt2_name && H5B2_close(bt2_name) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index")
+ if(bt2_corder && H5B2_close(bt2_corder) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index")
if(attr_copy)
H5O_msg_free(H5O_ATTR_ID, attr_copy);
diff --git a/test/tattr.c b/test/tattr.c
index 9b6ae90..7e07ee0 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -2604,6 +2604,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
H5O_info_t oinfo; /* Object info */
unsigned u; /* Local index variable */
int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
+ unsigned use_corder; /* Track creation order or not */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -2620,7 +2621,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
}
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
if (use_min_dset_oh)
CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
@@ -2635,71 +2636,87 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Create dataspace for dataset */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Query the group creation properties */
dcpl = (use_min_dset_oh) ? H5Pcopy(dcpl_g) : H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
-
- /* Create a dataset */
- dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcopy");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
- /* Close property list */
- ret = H5Pclose(dcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Using creation order or not */
+ for(use_corder = FALSE; use_corder <= TRUE; use_corder++) {
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ if(use_corder) {
+ ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
+ CHECK(ret, FAIL, "H5Pset_attr_creation_order");
+ }
- /* Add attributes, until well into dense storage */
- for(u = 0; u < (max_compact * 2); u++) {
- /* Create attribute */
- sprintf(attrname, "attr %02u", u);
- attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
- /* Write data into the attribute */
- ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
- CHECK(ret, FAIL, "H5Awrite");
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O_is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
- /* Close attribute */
- ret = H5Aclose(attr);
- CHECK(ret, FAIL, "H5Aclose");
+ /* Add attributes, until well into dense storage */
+ for(u = 0; u < (max_compact * 2); u++) {
+ /* Create attribute */
+ sprintf(attrname, "attr %02u", u);
+ attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Write data into the attribute */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
+ CHECK(ret, FAIL, "H5Awrite");
- /* Rename attribute */
- sprintf(new_attrname, "new attr %02u", u);
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
- /* Rename attribute */
- ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Arename_by_name");
+ /* Rename attribute */
+ sprintf(new_attrname, "new attr %02u", u);
- /* Check # of attributes */
- ret = H5Oget_info2(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
- } /* end for */
+ /* Rename attribute */
+ ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Arename_by_name");
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ /* Check # of attributes */
+ ret = H5Oget_info2(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info");
+ VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
+ } /* end for */
+
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O_is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ if(!use_corder) {
+ /* Unlink dataset with attributes */
+ ret = H5Ldelete(fid, DSET1_NAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ }
+
+ } /* end for use_corder */
/* Close dataspace */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
- /* Close Dataset */
- ret = H5Dclose(dataset);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(fid);
@@ -2708,11 +2725,11 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Open dataset */
dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Verify renamed attributes */
for(u = 0; u < (max_compact * 2); u++) {
@@ -2721,7 +2738,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Open attribute */
sprintf(attrname, "new attr %02u", u);
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
+ CHECK(attr, H5I_INVALID_HID, "H5Aopen");
/* Read data from the attribute */
ret = H5Aread(attr, H5T_NATIVE_UINT, &value);