diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-12-27 03:53:47 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-12-27 03:53:47 (GMT) |
commit | b00962ac8694b14b74382f77d1cf849b93383fb5 (patch) | |
tree | 6833353ed1959b51e94a0228498bf3ce519670f9 /c++/test/tobject.cpp | |
parent | 96c28287935c50693e19d473537b4f58692a30f8 (diff) | |
parent | e05da1b533d5eb9527a5b67ba2683379f8e1e7ac (diff) | |
download | hdf5-b00962ac8694b14b74382f77d1cf849b93383fb5.zip hdf5-b00962ac8694b14b74382f77d1cf849b93383fb5.tar.gz hdf5-b00962ac8694b14b74382f77d1cf849b93383fb5.tar.bz2 |
Merge pull request #209 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_cpp:develop to develop
- Replacing openXxxType with individual type constructors
- Put back CommonFG
- Removed overloaded constructors that take an Attribute where there is one that takes an H5Location
* commit 'e05da1b533d5eb9527a5b67ba2683379f8e1e7ac':
Description: Removed commented out code and fixed miscellaneous typos. Platforms tested: Linux/32 2.6 (jam) (very minor)
Purpose: Improvement for HDFFV-10004 Description: When adding wrappers for H5Lexists, a new class, LinkAccPropList, was added to the C++ API, triggered complicated circular dependencies. Thus, some improvement was made to resolve the problems. - Replaced existing functions openXxxType with individual type constructors + Added individual XxxType constructors to replace the existing functions openXxxType because it's rather awkward to use these functions. + Moved openXxxType from H5Location back to CommonFG + Put back CommonFG as a baseclass of Group for openXxxType functions. + This replacement should improve usability and prevent the problem of circular dependencies. - Removed overloaded constructor that takes an Attribute when there is already one that takes H5Location because Attribute inherits from H5Location now. Platforms tested: Linux/32 2.6 (jam) Darwin (osx1010test) Linux/64 (platypus)
Diffstat (limited to 'c++/test/tobject.cpp')
-rw-r--r-- | c++/test/tobject.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index b8654c3..e142f02 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -23,8 +23,6 @@ #else #include <iostream> #endif -using std::cerr; -using std::endl; #include <string> #include "H5Cpp.h" // C++ API header file @@ -184,6 +182,16 @@ static void test_get_objname_ontypes() H5std_string inttype_name = inttype.getObjName(); verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + // Close the type then open it again to test getting its name with + // the constructor + inttype.close(); + IntType newtype(file, "INT type of STD_B8LE"); + + // Get and verify its name + H5std_string type_name = newtype.getObjName(); + verify_val(type_name, "/INT type of STD_B8LE", "DataType::getObjName tests constructor", __LINE__, __FILE__); + newtype.close(); + // Make copy of a predefined type and save it DataType dtype(PredType::STD_B8LE); dtype.commit(file, "STD_B8LE"); @@ -197,7 +205,14 @@ static void test_get_objname_ontypes() dtype = file.openDataType("STD_B8LE"); // Get and verify its name - H5std_string type_name = dtype.getObjName(); + type_name = dtype.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Repeat the test with openDataType's replacement + DataType dtype2(file, "STD_B8LE"); + + // Get and verify its name + type_name = dtype2.getObjName(); verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); // Test getting type's name from copied type |