diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 16:56:53 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 16:56:53 (GMT) |
commit | d95f36686b2a68bcd848d68bcb81be520d01f037 (patch) | |
tree | 4b2a16506fd6b76f3c86d30c82f2d83a26b60869 /c++/test/tattr.cpp | |
parent | 8a504025690129d1d952b06bc4c757f4fcc34548 (diff) | |
parent | 3aa24435180d10aeca6493f7c1b277cfd5c73fad (diff) | |
download | hdf5-d95f36686b2a68bcd848d68bcb81be520d01f037.zip hdf5-d95f36686b2a68bcd848d68bcb81be520d01f037.tar.gz hdf5-d95f36686b2a68bcd848d68bcb81be520d01f037.tar.bz2 |
Merge pull request #1140 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_cpp4:develop to develop
Fixed part of HDFFV-10458: wrappers for H5Oget_info2, H5Oget_info_by_name2, and H5Oget_info_by_idx2.
* commit '3aa24435180d10aeca6493f7c1b277cfd5c73fad':
Fixed HDFFV-10458 partially Description: Added wrappers for H5Oget_info_by_idx2.
Fixed comments
Fixed HDFFV-10458 partially Description: Added wrappers for H5Oget_info2 and H5Oget_info_by_name2.
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); |