summaryrefslogtreecommitdiffstats
path: root/c++/test/tattr.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-10 18:04:28 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-10 18:04:28 (GMT)
commitc32b7387083d574bfa5fc31fffc45cbf21b6a1f0 (patch)
tree665af0c032ce6dda6d110da87e4a66d05b016bb2 /c++/test/tattr.cpp
parentffd98d490f04952e01629c6378c4528459db9f9a (diff)
downloadhdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.zip
hdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.tar.gz
hdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.tar.bz2
C++ API improvement
Description: - Reorganized some exception classes to reflect the HDF5 object hierarchy and provide extendibility. DataSetIException -> LocationException -> Exception DataTypeIException -> LocationException -> Exception GroupIException -> LocationException -> Exception AttributeIException -> LocationException -> Exception FileIException -> GroupIException -> LocationException -> Exception - Added throwException() to these subclasses and use it in H5Location and H5Object member functions to throw an exception that is specific to the object that invokes the member function. Applications that catch the base exception can continue to do the same. - Many cleanup for inconsistencies in comments/headers. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r--c++/test/tattr.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index d97d478..25b5ff8 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -653,7 +653,8 @@ static void test_attr_compound_read()
verify_val((long)dims[1], (long)ATTR4_DIM2, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
// Get the class of the datatype that is used by attr
- H5T_class_t type_class = attr.getTypeClass();
+ H5T_class_t type_class;
+ type_class = attr.getTypeClass();
// Verify that the type is of compound datatype
verify_val(type_class, H5T_COMPOUND, "Attribute::getTypeClass", __LINE__, __FILE__);
@@ -1289,6 +1290,7 @@ static void test_attr_dtype_shared()
// Retrieve and verify information about the type
H5O_info_t oinfo;
+ dtype.getObjectInfo(TYPE1_NAME, &oinfo);
fid1.getObjectInfo(TYPE1_NAME, &oinfo);
if (oinfo.type != H5O_TYPE_NAMED_DATATYPE)
TestErrPrintf("Line %d: object type wrong!\n", __LINE__);
@@ -1402,6 +1404,14 @@ static void test_attr_dtype_shared()
PASSED();
} // end try block
+ catch (DataTypeIException& E)
+ {
+ issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+ catch (FileIException& E)
+ {
+ issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
catch (Exception& E)
{
issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg());