diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 06:09:45 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 06:09:45 (GMT) |
commit | 14bf28780aa850928c0ffeae838f6dd6140bd615 (patch) | |
tree | 13515fcdfea82e30d1d3009359d973b3bfe9548c /c++/test/tattr.cpp | |
parent | fe916ada370f33b48b3c39dbf9e3ff73df00fdb7 (diff) | |
download | hdf5-14bf28780aa850928c0ffeae838f6dd6140bd615.zip hdf5-14bf28780aa850928c0ffeae838f6dd6140bd615.tar.gz hdf5-14bf28780aa850928c0ffeae838f6dd6140bd615.tar.bz2 |
Fixed HDFFV-10458 partially
Description:
Added wrappers for H5Oget_info2 and H5Oget_info_by_name2.
// Returns information about an HDF5 object.
void getInfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC)
// Returns information about an HDF5 object, given its name.
void getInfo(const char* name, H5O_info_t& objinfo,
unsigned fields = H5O_INFO_BASIC,
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT)
void getInfo(const H5std_string& name, H5O_info_t& objinfo,
unsigned fields = H5O_INFO_BASIC,
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT)
Platforms tested:
Linux/64 (jelly)
Linux/32 (jam)
Darwin (osx1010test)
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r-- | c++/test/tattr.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 5aa4bf5..94c811a 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -518,6 +518,12 @@ static void test_attr_basic_read() int num_attrs = dataset.getNumAttrs(); verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__); + // Verify the correct number of attributes another way + H5O_info_t oinfo; + HDmemset(&oinfo, 0, sizeof(oinfo)); + dataset.getInfo(oinfo, H5O_INFO_NUM_ATTRS); + verify_val(oinfo.num_attrs, 3, "DataSet::getInfo", __LINE__, __FILE__); + // Open an attribute for the dataset Attribute ds_attr=dataset.openAttribute(ATTR1_NAME); @@ -538,7 +544,12 @@ static void test_attr_basic_read() // Verify the correct number of attributes num_attrs = group.getNumAttrs(); - verify_val(num_attrs, 1, "H5Group::getNumAttrs", __LINE__, __FILE__); + verify_val(num_attrs, 1, "Group::getNumAttrs", __LINE__, __FILE__); + + // Verify the correct number of attributes another way + HDmemset(&oinfo, 0, sizeof(oinfo)); + group.getInfo(oinfo, H5O_INFO_NUM_ATTRS); + verify_val(oinfo.num_attrs, 1, "Group::getInfo", __LINE__, __FILE__); // Open an attribute for the group Attribute gr_attr = group.openAttribute(ATTR2_NAME); @@ -658,6 +669,12 @@ static void test_attr_compound_read() int num_attrs = dataset.getNumAttrs(); verify_val(num_attrs, 1, "DataSet::getNumAttrs", __LINE__, __FILE__); + // Verify the correct number of attributes another way + H5O_info_t oinfo; + HDmemset(&oinfo, 0, sizeof(oinfo)); + dataset.getInfo(oinfo, H5O_INFO_NUM_ATTRS); + verify_val(oinfo.num_attrs, 1, "DataSet::getInfo", __LINE__, __FILE__); + // Open 1st attribute for the dataset Attribute attr = dataset.openAttribute((unsigned)0); |