summaryrefslogtreecommitdiffstats
path: root/c++/test/trefer.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2010-05-02 19:15:43 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2010-05-02 19:15:43 (GMT)
commit85ca829e712aa303e74806fc1d9af8b900fdbc4f (patch)
treef73d94650d485f7c90d88c61449eb770a7730efc /c++/test/trefer.cpp
parent54cd6ecec92e81bdcac3299b844a61f14bc89d69 (diff)
downloadhdf5-85ca829e712aa303e74806fc1d9af8b900fdbc4f.zip
hdf5-85ca829e712aa303e74806fc1d9af8b900fdbc4f.tar.gz
hdf5-85ca829e712aa303e74806fc1d9af8b900fdbc4f.tar.bz2
[svn-r18685] Description:
Added missing overloaded function getObjTypeByIdx to return type name as a char*. Platforms tested: Linux/32 2.6 (jam) FreeBSD/64 6.3 (liberty) SunOS 5.10 (linew)
Diffstat (limited to 'c++/test/trefer.cpp')
-rw-r--r--c++/test/trefer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index 41ee808..d17e6e3 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -249,6 +249,26 @@ static void test_reference_obj(void)
verify_val(name, DSET1_NAME, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__);
verify_val(name_size, DSET1_LEN, "Group::getObjnameByIdx(index,(char*)buf,buf_len)", __LINE__, __FILE__);
+ // Test getting the type of objects
+
+ // Test getObjTypeByIdx(hsize_t idx)
+ obj_type = group.getObjTypeByIdx(0);
+ verify_val(obj_type, H5G_DATASET, "Group::getObjTypeByIdx(index)", __LINE__, __FILE__);
+
+ // Test getObjTypeByIdx(hsize_t idx, char* type_name)
+ obj_type = H5G_UNKNOWN;
+ char type_name_C[256];
+ obj_type = group.getObjTypeByIdx(0, type_name_C);
+ verify_val(obj_type, H5G_DATASET, "Group::getObjTypeByIdx(index, (char*)name)", __LINE__, __FILE__);
+ verify_val((const char*)type_name_C, (const char*)"dataset", "Group::getObjTypeByIdx(index, (char*)name)", __LINE__, __FILE__);
+
+ // Test getObjTypeByIdx(hsize_t idx, H5std_string& type_name)
+ obj_type = H5G_UNKNOWN;
+ H5std_string type_name;
+ obj_type = group.getObjTypeByIdx(0, type_name);
+ verify_val(obj_type, H5G_DATASET, "Group::getObjTypeByIdx(index, (char*)name)", __LINE__, __FILE__);
+ verify_val(type_name, "dataset", "Group::getObjTypeByIdx(index, (char*)name)", __LINE__, __FILE__);
+
// Close group
group.close();