summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-07 04:58:06 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-07 04:58:06 (GMT)
commit01b3b7bf479477c60f11dcbb101fcfd29becbdc1 (patch)
tree508729c465052bf56fb3ad4e752293bdba72aacf /c++/test
parentc1e82e516fb6c8c7fe40be385ef09dd5502205f0 (diff)
downloadhdf5-01b3b7bf479477c60f11dcbb101fcfd29becbdc1.zip
hdf5-01b3b7bf479477c60f11dcbb101fcfd29becbdc1.tar.gz
hdf5-01b3b7bf479477c60f11dcbb101fcfd29becbdc1.tar.bz2
C++ API improvement
Description: - Added another argument, LinkCreatPropList& lcpl, to the CommonFG::createGroup() functions for the use of link creation property list. The new argument has a default value. Group createGroup(const char* name, size_t size_hint = 0, const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) Group createGroup(const H5std_string& name, size_t size_hint = 0, const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) - Removed memory leaks caused by accidentally invoking p_get_member_type (in H5CompType.cpp, user reported via email, maybe no jira issue) - Made H5Location::closeObjId static, so no object is needed to close an hdf5 id. - Added classes StrCreatPropList, LinkCreatPropList, AttrCreatPropList for the C property list classes H5P_STRING_CREATE, H5P_LINK_CREATE, and H5P_ATTRIBUTE_CREATE. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/tfile.cpp27
-rw-r--r--c++/test/tobject.cpp6
2 files changed, 28 insertions, 5 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 059c548..23cf280 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -336,9 +336,12 @@ static void test_file_open()
// Truncating should succeed now.
H5File file3(FILE2, H5F_ACC_TRUNC);
- // Opening another file to file3 object, FILE2 should be closed, so
- // the next attempt to truncate FILE2 should succeed.
+ // Opening another file to file3 object.
file3.openFile(FILE1, H5F_ACC_RDONLY);
+
+ // In the previous statement, openFile closes FILE2 first before
+ // opening FILE1, so when H5File constructs file4 with an
+ // attempt to truncate FILE2, it should succeed.
H5File file4(FILE2, H5F_ACC_TRUNC);
PASSED();
@@ -493,6 +496,17 @@ static void test_file_name()
// Get and verify file name via a committed datatype.
comp_type.getFileName();
verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__);
+
+ /* file4.close();
+file4.openFile(FILE4, H5F_ACC_RDWR);
+ */
+ // Get the file's version information.
+ H5F_info_t finfo;
+ file4.getFileInfo(finfo); // there's no C test for H5Fget_info
+ /* cerr << "file4: super_ext_size = " << finfo.super_ext_size << endl;
+ */
+ //verify_val(finfo.sohm.hdr_size, 0, "H5File::getFileInfo", __LINE__, __FILE__);
+
PASSED();
} // end of try block
@@ -503,6 +517,15 @@ static void test_file_name()
} // test_file_name()
+/*-------------------------------------------------------------------------
+ *
+ * Function: test_file_attribute
+ *
+ * Purpose Test file attributes
+ *
+ * Return None
+ *-------------------------------------------------------------------------
+ */
const int RANK1 = 1;
const int ATTR1_DIM1 = 3;
const H5std_string FILE5("tfattrs.h5");
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index c053604..54d62f2 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -361,7 +361,7 @@ static void test_open_object_header()
// There should be one object, the datatype
// Close datatype object opened from the file
- file1.closeObjId(obj_dtype);
+ H5Location::closeObjId(obj_dtype);
dset.setId(obj_dset);
dspace = dset.getSpace();
@@ -377,10 +377,10 @@ static void test_open_object_header()
dtype.close();
// Close datatype object
- grp2.closeObjId(obj_dtype);
+ H5Location::closeObjId(obj_dtype);
// Close the group object
- file1.closeObjId(obj_grp);
+ H5Location::closeObjId(obj_grp);
// Try doing something with group, the ID should still work
num_objs = grp2.getNumObjs();