summaryrefslogtreecommitdiffstats
path: root/c++/test/trefer.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2010-04-27 20:19:20 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2010-04-27 20:19:20 (GMT)
commita0911ce3de9a658076ef0c115f38bb6ba131a9ef (patch)
treeef9da016cf667a07f6b02b955c2dead8f7d7fb9d /c++/test/trefer.cpp
parent97f4486769962315a8229f16485cd3740b8d22c5 (diff)
downloadhdf5-a0911ce3de9a658076ef0c115f38bb6ba131a9ef.zip
hdf5-a0911ce3de9a658076ef0c115f38bb6ba131a9ef.tar.gz
hdf5-a0911ce3de9a658076ef0c115f38bb6ba131a9ef.tar.bz2
[svn-r18640] Description:
Added a null character to terminate a fixed-length string returned by H5Aread. Platforms tested: Linux/32 2.6 (jam) FreeBSD/64 6.3 (liberty)
Diffstat (limited to 'c++/test/trefer.cpp')
-rw-r--r--c++/test/trefer.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index 3875dfd..16f6628 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -216,11 +216,20 @@ static void test_reference_obj(void)
H5std_string read_comment1 = group.getComment(".", 10);
verify_val(read_comment1, write_comment, "Group::getComment", __LINE__, __FILE__);
- // Test that getComment handles failures gracefully
- try {
- H5std_string read_comment_tmp = group.getComment(NULL);
- }
- catch (Exception E) {} // We expect this to fail
+ // Test that getComment handles failures gracefully
+ try {
+ H5std_string read_comment_tmp = group.getComment(NULL);
+ }
+ catch (Exception E) {} // We expect this to fail
+
+ // Test reading the name of an item in the group
+ H5std_string name;
+ name = group.getObjnameByIdx(0);
+ verify_val(name, "Dataset1", "Group::getObjnameByIdx", __LINE__, __FILE__);
+ name.clear();
+ ssize_t name_size = group.getObjnameByIdx(0, name, 5);
+ verify_val(name, "Data", "Group::getObjnameByIdx(index,buf,buf_len)", __LINE__, __FILE__);
+ verify_val(name_size, 8, "Group::getObjnameByIdx(index,buf,buf_len)", __LINE__, __FILE__);
// Close group
group.close();