diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 14:12:10 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 14:12:10 (GMT) |
commit | 3aa24435180d10aeca6493f7c1b277cfd5c73fad (patch) | |
tree | 4b2a16506fd6b76f3c86d30c82f2d83a26b60869 /c++/test/trefer.cpp | |
parent | 944735221e3dc6545aca753b09041cef7ea09fb1 (diff) | |
download | hdf5-3aa24435180d10aeca6493f7c1b277cfd5c73fad.zip hdf5-3aa24435180d10aeca6493f7c1b277cfd5c73fad.tar.gz hdf5-3aa24435180d10aeca6493f7c1b277cfd5c73fad.tar.bz2 |
Fixed HDFFV-10458 partially
Description:
Added wrappers for H5Oget_info_by_idx2.
// Returns information about an HDF5 object, given its index.
void getInfo(const char* grp_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
unsigned fields = H5O_INFO_BASIC,
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT)
void getInfo(const H5std_string& grp_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t idx, 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/trefer.cpp')
-rw-r--r-- | c++/test/trefer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index bb09616..fa214df 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -481,6 +481,21 @@ static void test_reference_group() fname = group.getFileName(); verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + // Check object type using Group::getInfo() + H5O_info_t oinfo; + HDmemset(&oinfo, 0, sizeof(oinfo)); + group.getInfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, oinfo); + verify_val(oinfo.type, H5O_TYPE_DATASET, "Group::getInfo",__LINE__,__FILE__); + + // Check for out of bound query by index + try { + HDmemset(&oinfo, 0, sizeof(oinfo)); + group.getInfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)9, oinfo); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getInfo", "Out of bound index."); + } catch (Exception& err) {} // do nothing, failure expected + // Unlink one of the objects in the dereferenced group, and re-check refgroup.unlink(GROUPNAME2); nobjs = refgroup.getNumObjs(); |