summaryrefslogtreecommitdiffstats
path: root/c++/test/dsets.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-03-21 23:23:05 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-03-21 23:23:05 (GMT)
commit60df159d33d8793dd5764e2ae032e0e89fc44c9b (patch)
tree8a83268f8ee902901d982d33b380568a2962f9ab /c++/test/dsets.cpp
parent2e4302818ab260604ffa26e90dab159cf28079d4 (diff)
downloadhdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.zip
hdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.tar.gz
hdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.tar.bz2
[svn-r24865] Description:
- Added another overload for char* argument: ssize_t getComment(const char* name, const size_t buf_size, char* comment) - Changed default value to 0 for the other two getComment methods - Added HDmemset to after every char string allocation to clear the buffer Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) Linux/64 2.6 (platypus)/PGI compilers
Diffstat (limited to 'c++/test/dsets.cpp')
-rw-r--r--c++/test/dsets.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 811d8c7..b6922c2 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -120,6 +120,11 @@ test_create( H5File& file)
// way to open an existing dataset for accessing.
dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME));
+ // Get and verify the comment from this dataset, using
+ // H5std_string getComment(const H5std_string& name, <buf_size=0, by default>)
+ H5std_string comment = file.getComment(DSET_DEFAULT_NAME);
+ verify_val(comment, "This is a dataset", "H5Location::getComment", __LINE__, __FILE__);
+
// Close the dataset when accessing is completed
delete dataset;
@@ -1067,6 +1072,12 @@ void test_dset()
nerrors += test_multiopen (file)<0 ?1:0;
nerrors += test_types(file)<0 ?1:0;
+ // Get part of the comment, random length using
+ // ssize_t getComment(const char* name, const size_t buf_size, char* comment)
+ char* comment = new char[11];
+ ssize_t comment_len = file.getComment("emit diagnostics", 10, comment);
+ verify_val((const char*)comment, "Causes dia", "H5Location::getComment", __LINE__, __FILE__);
+
// Close group "emit diagnostics".
grp.close();