summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2016-04-22 22:42:22 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2016-04-22 22:42:22 (GMT)
commitd490c837eb601c4a7eee8fba62ce8ba9adb0e9a1 (patch)
tree604b7e94e35625072c61f2a286862f779dba93c6
parent58803d08320c0f704bc4cca600e9701572ddc1b4 (diff)
downloadhdf5-d490c837eb601c4a7eee8fba62ce8ba9adb0e9a1.zip
hdf5-d490c837eb601c4a7eee8fba62ce8ba9adb0e9a1.tar.gz
hdf5-d490c837eb601c4a7eee8fba62ce8ba9adb0e9a1.tar.bz2
[svn-r29769] Purpose: Code improvements
Description: - Changed object in catch statements to reference - Replaced old-style casts or reinterpret_cast with static_cast - Removed unused name H5Library::need_cleanup - Removed Exception::printError from documentation Merged from trunk r29759 and r29766 Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
-rw-r--r--c++/src/H5AbstractDs.cpp36
-rw-r--r--c++/src/H5ArrayType.cpp2
-rw-r--r--c++/src/H5Attribute.cpp8
-rw-r--r--c++/src/H5CompType.cpp16
-rw-r--r--c++/src/H5DataSet.cpp4
-rw-r--r--c++/src/H5DataSpace.cpp6
-rw-r--r--c++/src/H5DataType.cpp8
-rw-r--r--c++/src/H5Exception.cpp9
-rw-r--r--c++/src/H5File.cpp12
-rw-r--r--c++/src/H5Group.cpp4
-rw-r--r--c++/src/H5IdComponent.cpp2
-rw-r--r--c++/src/H5Library.cpp7
-rw-r--r--c++/src/H5Library.h5
-rw-r--r--c++/src/H5Location.cpp16
-rw-r--r--c++/src/H5PropList.cpp6
-rw-r--r--c++/test/dsets.cpp36
-rw-r--r--c++/test/h5cpputil.cpp16
-rw-r--r--c++/test/tarray.cpp6
-rw-r--r--c++/test/tattr.cpp79
-rw-r--r--c++/test/tcompound.cpp33
-rw-r--r--c++/test/tdspl.cpp3
-rw-r--r--c++/test/testhdf5.cpp2
-rw-r--r--c++/test/tfile.cpp33
-rw-r--r--c++/test/tfilter.cpp6
-rw-r--r--c++/test/th5s.cpp18
-rw-r--r--c++/test/tlinks.cpp6
-rw-r--r--c++/test/tobject.cpp6
-rw-r--r--c++/test/trefer.cpp24
-rw-r--r--c++/test/ttypes.cpp28
-rw-r--r--c++/test/tvlstr.cpp31
30 files changed, 252 insertions, 216 deletions
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 8d88c53..6dee337 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -68,10 +68,10 @@ H5T_class_t AbstractDs::getTypeClass() const
try {
datatype_id = p_get_type(); // returned value is already validated
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg());
}
@@ -118,10 +118,10 @@ DataType AbstractDs::getDataType() const
f_DataType_setId(&datatype, p_get_type());
return(datatype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getDataType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getDataType", E.getDetailMsg());
}
}
@@ -148,10 +148,10 @@ ArrayType AbstractDs::getArrayType() const
arraytype.setArrayInfo();
return(arraytype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg());
}
}
@@ -175,10 +175,10 @@ CompType AbstractDs::getCompType() const
f_DataType_setId(&comptype, p_get_type());
return(comptype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getCompType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getCompType", E.getDetailMsg());
}
}
@@ -202,10 +202,10 @@ EnumType AbstractDs::getEnumType() const
f_DataType_setId(&enumtype, p_get_type());
return(enumtype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg());
}
}
@@ -229,10 +229,10 @@ IntType AbstractDs::getIntType() const
f_DataType_setId(&inttype, p_get_type());
return(inttype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getIntType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getIntType", E.getDetailMsg());
}
}
@@ -256,10 +256,10 @@ FloatType AbstractDs::getFloatType() const
f_DataType_setId(&floatype, p_get_type());
return(floatype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg());
}
}
@@ -283,10 +283,10 @@ StrType AbstractDs::getStrType() const
f_DataType_setId(&strtype, p_get_type());
return(strtype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getStrType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getStrType", E.getDetailMsg());
}
}
@@ -310,10 +310,10 @@ VarLenType AbstractDs::getVarLenType() const
f_DataType_setId(&varlentype, p_get_type());
return(varlentype);
}
- catch (DataSetIException E) {
+ catch (DataSetIException& E) {
throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg());
}
- catch (AttributeIException E) {
+ catch (AttributeIException& E) {
throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg());
}
}
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index 9731a13..37cd8c1 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -112,7 +112,7 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs)
// Note: a = b, so there are two objects with the same hdf5 id
// that's why incRefCount is needed, and it is called by setId
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataTypeIException(inMemFunc("operator="), close_error.getDetailMsg());
}
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index bf45fe4..821f601 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -293,7 +293,7 @@ H5std_string Attribute::getFileName() const
try {
return(p_get_file_name());
}
- catch (IdComponentException E) {
+ catch (IdComponentException& E) {
throw FileIException("Attribute::getFileName", E.getDetailMsg());
}
}
@@ -348,7 +348,7 @@ H5std_string Attribute::getName() const
H5std_string attr_name(""); // attribute name to return
// Preliminary call to get the size of the attribute name
- ssize_t name_size = H5Aget_name(id, (size_t)0, NULL);
+ ssize_t name_size = H5Aget_name(id, static_cast<size_t>(0), NULL);
// If H5Aget_name failed, throw exception
if (name_size < 0)
@@ -630,7 +630,7 @@ void Attribute::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -674,7 +674,7 @@ Attribute::~Attribute()
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp
index 82575d6..5668ec3 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -232,7 +232,7 @@ DataType CompType::getMemberDataType( unsigned member_num ) const
f_DataType_setId(&datatype, p_get_member_type(member_num));
return(datatype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg());
}
}
@@ -254,7 +254,7 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const
arraytype.setArrayInfo();
return(arraytype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg());
}
}
@@ -275,7 +275,7 @@ CompType CompType::getMemberCompType( unsigned member_num ) const
f_DataType_setId(&comptype, p_get_member_type(member_num));
return(comptype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg());
}
}
@@ -296,7 +296,7 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const
f_DataType_setId(&enumtype, p_get_member_type(member_num));
return(enumtype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg());
}
}
@@ -317,7 +317,7 @@ IntType CompType::getMemberIntType( unsigned member_num ) const
f_DataType_setId(&inttype, p_get_member_type(member_num));
return(inttype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg());
}
}
@@ -338,7 +338,7 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const
f_DataType_setId(&floatype, p_get_member_type(member_num));
return(floatype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg());
}
}
@@ -359,7 +359,7 @@ StrType CompType::getMemberStrType( unsigned member_num ) const
f_DataType_setId(&strtype, p_get_member_type(member_num));
return(strtype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg());
}
}
@@ -380,7 +380,7 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const
f_DataType_setId(&varlentype, p_get_member_type(member_num));
return(varlentype);
}
- catch (DataTypeIException E) {
+ catch (DataTypeIException& E) {
throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg());
}
}
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index a6a4a62..b3ad708 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -728,7 +728,7 @@ void DataSet::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataSetIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -788,7 +788,7 @@ DataSet::~DataSet()
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index 8fceca4..b8ce529 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -167,7 +167,7 @@ void DataSpace::copy( const DataSpace& like_space )
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg());
}
} // end if
@@ -641,7 +641,7 @@ void DataSpace::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataSpaceIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -685,7 +685,7 @@ DataSpace::~DataSpace()
{
try {
close();
- } catch (Exception close_error) {
+ } catch (Exception& close_error) {
cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 08b317e..efe46de 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -177,7 +177,7 @@ void DataType::copy( const DataType& like_type )
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
}
@@ -202,7 +202,7 @@ void DataType::copy(const DataSet& dset)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
}
@@ -721,7 +721,7 @@ void DataType::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw DataTypeIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -774,7 +774,7 @@ DataType::~DataType()
{
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index e3c6a62..9df861a 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -312,14 +312,15 @@ void Exception::printErrorStack(FILE* stream, hid_t err_stack)
//--------------------------------------------------------------------------
// Function: Exception::printError
-///\brief Prints the error stack in a default manner. This member
-/// function is replaced by the static function printErrorStack
-/// and will be removed from the next major release.
-///\param stream - IN: File pointer
+// Purpose: Prints the error stack in a default manner. This member
+// function is replaced by the static function printErrorStack
+// and will be removed from the next major release.
+// Parameter stream - IN: File pointer
// Programmer Binh-Minh Ribler - 2000
// Description:
// This function can be removed in next major release.
// -BMR, 2014/04/24
+// Removed from documentation. -BMR, 2016/03/23
//--------------------------------------------------------------------------
void Exception::printError(FILE* stream) const
{
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index 69eaa89..227e1c5 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -88,7 +88,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
{
try {
p_get_file(name, flags, create_plist, access_plist);
- } catch (FileIException open_file) {
+ } catch (FileIException& open_file) {
throw open_file;
}
}
@@ -113,7 +113,7 @@ H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPro
{
try {
p_get_file(name.c_str(), flags, create_plist, access_plist);
- } catch (FileIException open_file) {
+ } catch (FileIException& open_file) {
throw open_file;
}
}
@@ -245,7 +245,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw FileIException("H5File::openFile", close_error.getDetailMsg());
}
@@ -294,7 +294,7 @@ void H5File::reOpen()
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw FileIException("H5File::reOpen", close_error.getDetailMsg());
}
@@ -569,7 +569,7 @@ void H5File::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception E) {
+ catch (Exception& E) {
throw FileIException("H5File::p_setId", E.getDetailMsg());
}
// reset object's id to the given id
@@ -633,7 +633,7 @@ H5File::~H5File()
{
try {
close();
- } catch (Exception close_error) {
+ } catch (Exception& close_error) {
cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index d679960..0f2ff04 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -154,7 +154,7 @@ void Group::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw GroupIException("Group::p_setId", close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -219,7 +219,7 @@ Group::~Group()
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
cerr << "Group::~Group - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index 60735f0..4f8c4a2 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -207,7 +207,7 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
// Note: a = b, so there are two objects with the same hdf5 id
// that's why incRefCount is needed, and it is called by setId
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw FileIException(inMemFunc("operator="), close_error.getDetailMsg());
}
}
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index be80fe4..471dbad 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -37,13 +37,6 @@
namespace H5 {
#endif
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-// This static variable is unused, will be removed in future releases.
-bool H5Library::need_cleanup = false;
-
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
//--------------------------------------------------------------------------
// Function: H5Library::open (static)
///\brief Initializes the HDF5 library.
diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h
index 336f9c8..308881b 100644
--- a/c++/src/H5Library.h
+++ b/c++/src/H5Library.h
@@ -29,11 +29,6 @@ namespace H5 {
*/
class H5_DLLCPP H5Library {
public:
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- static bool need_cleanup; // indicates if H5close should be called
- // - unused, will be removed in future releases.
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
// Initializes the HDF5 library.
static void open();
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 56ed178..062d5ec 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -230,7 +230,7 @@ int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_
userData->location = this;
// call the C library routine H5Aiterate2 to iterate the attributes
- hsize_t idx = _idx ? (hsize_t)*_idx : 0;
+ hsize_t idx = _idx ? static_cast<hsize_t>(*_idx) : 0;
int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
userAttrOpWrpr, static_cast<void *>(userData));
@@ -387,7 +387,7 @@ H5std_string H5Location::getFileName() const
try {
return(p_get_file_name());
}
- catch (LocationException E) {
+ catch (LocationException& E) {
throw FileIException(inMemFunc("getFileName"), E.getDetailMsg());
}
}
@@ -634,7 +634,7 @@ void H5Location::reference(void* ref, const char* name, const DataSpace& dataspa
try {
p_reference(ref, name, dataspace.getId(), ref_type);
}
- catch (ReferenceException E) {
+ catch (ReferenceException& E) {
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
}
}
@@ -660,7 +660,7 @@ void H5Location::reference(void* ref, const H5std_string& name, const DataSpace&
try {
p_reference(ref, name.c_str(), dataspace.getId(), ref_type);
}
- catch (ReferenceException E) {
+ catch (ReferenceException& E) {
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
}
}
@@ -684,7 +684,7 @@ void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) con
try {
p_reference(ref, name, -1, ref_type);
}
- catch (ReferenceException E) {
+ catch (ReferenceException& E) {
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
}
}
@@ -793,7 +793,7 @@ H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const
try {
return(p_get_obj_type(ref, ref_type));
}
- catch (ReferenceException E) {
+ catch (ReferenceException& E) {
throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg());
}
}
@@ -849,7 +849,7 @@ H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const
try {
return(p_get_ref_obj_type(ref, ref_type));
}
- catch (ReferenceException E) {
+ catch (ReferenceException& E) {
throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg());
}
}
@@ -915,7 +915,7 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
f_DataSpace_setId(&dataspace, space_id);
return(dataspace);
}
- catch (DataSpaceIException E) {
+ catch (DataSpaceIException& E) {
throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg());
}
}
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index b954191..6655900 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -169,7 +169,7 @@ void PropList::copy( const PropList& like_plist )
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg());
}
@@ -301,7 +301,7 @@ void PropList::p_setId(const hid_t new_id)
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
throw PropListIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -747,7 +747,7 @@ PropList::~PropList()
try {
close();
}
- catch (Exception close_error) {
+ catch (Exception& close_error) {
cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index f35696a..6f60950 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -116,7 +116,7 @@ test_create( H5File& file)
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset");
}
- catch (FileIException E) // catching invalid creating dataset
+ catch (FileIException& E) // catching invalid creating dataset
{} // do nothing, exception expected
// Open the dataset we created above and then close it. This is one
@@ -148,7 +148,7 @@ test_create( H5File& file)
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset");
}
- catch (FileIException E ) // catching creating non-existent dataset
+ catch (FileIException& E ) // catching creating non-existent dataset
{} // do nothing, exception expected
// Create a new dataset that uses chunked storage instead of the default
@@ -170,7 +170,7 @@ test_create( H5File& file)
return 0;
} // outer most try block
- catch (InvalidActionException E)
+ catch (InvalidActionException& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -181,7 +181,7 @@ test_create( H5File& file)
return -1;
}
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_create", __LINE__, __FILE__);
@@ -246,7 +246,7 @@ test_simple_io( H5File& file)
DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space));
// Write the data to the dataset
- dataset.write (static_cast<void*>(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
+ dataset.write(static_cast<void*>(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
// Read the dataset back
dataset.read (static_cast<void*>(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
@@ -267,7 +267,7 @@ test_simple_io( H5File& file)
} // end try
// catch all dataset, space, plist exceptions
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -339,7 +339,7 @@ test_datasize(FileAccPropList &fapl)
} // end try
// catch all dataset, space, plist exceptions
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -419,7 +419,7 @@ test_tconv( H5File& file)
} // end try
// catch all dataset and space exceptions
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -504,6 +504,7 @@ test_compression(H5File& file)
points[i][j] = (int)n++;
}
}
+
char* tconv_buf = new char [1000];
DataSet* dataset = NULL;
try
@@ -738,7 +739,7 @@ test_compression(H5File& file)
} // end try
// catch all dataset, file, space, and plist exceptions
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -824,7 +825,7 @@ test_multiopen (H5File& file)
} // end try block
// catch all dataset, file, space, and plist exceptions
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -907,7 +908,7 @@ test_types(H5File& file)
} // end try block of bitfield_1
// catch exceptions thrown in try block of bitfield_1
- catch (Exception E)
+ catch (Exception& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << "bitfield_1: " << E.getFuncName()
@@ -939,7 +940,8 @@ test_types(H5File& file)
} // end try block of bitfield_2
// catch exceptions thrown in try block of bitfield_2
- catch (Exception E) {
+ catch (Exception& E)
+ {
cerr << " FAILED" << endl;
cerr << " <<< " << "bitfield_2: " << E.getFuncName()
<< " - " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -971,7 +973,8 @@ test_types(H5File& file)
} // end try block of opaque_1
// catch exceptions thrown in try block of opaque_1
- catch (Exception E) {
+ catch (Exception& E)
+ {
cerr << " FAILED" << endl;
cerr << " <<< " << "opaque_1: " << E.getFuncName()
<< " - " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -1004,7 +1007,8 @@ test_types(H5File& file)
} //end try block of opaque_2
// catch exceptions thrown in try block of opaque_2
- catch (Exception E) {
+ catch (Exception& E)
+ {
cerr << " FAILED" << endl;
cerr << " <<< " << "opaque_2: " << E.getFuncName()
<< " - " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -1019,7 +1023,7 @@ test_types(H5File& file)
return 0;
} // end top try block
- catch (Exception E)
+ catch (Exception& E)
{
return -1;
}
@@ -1084,7 +1088,7 @@ void test_dset()
nerrors += test_datasize(fapl) <0 ? 1:0;
}
- catch (Exception E)
+ catch (Exception& E)
{
test_report(nerrors, H5std_string(" Dataset"));
}
diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp
index 7ad7364..f56782f 100644
--- a/c++/test/h5cpputil.cpp
+++ b/c++/test/h5cpputil.cpp
@@ -156,8 +156,8 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck)
if (apoint != acheck)
{
cerr << " Read different values than written.\n" << endl;
- cerr << " At index " << (unsigned long)i << "," <<
- (unsigned long)j << endl;
+ cerr << " At index " << static_cast<unsigned long>(i) << "," <<
+ static_cast<unsigned long>(j) << endl;
return -1;
}
return 0;
@@ -212,10 +212,10 @@ InvalidActionException::InvalidActionException():Exception(){}
// which the failure should have occurred but didn't, and a
// message explaining why it should fail.
// Parameters
-// func_name - IN: Name of the function where failure should occur
-// message - IN: Message
+// func - IN: Name of the function where failure should occur
+// message - IN: Message
//--------------------------------------------------------------------------
-InvalidActionException::InvalidActionException(const H5std_string func_name, const H5std_string message) : Exception(func_name, message) {}
+InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: InvalidActionException destructor
@@ -234,10 +234,10 @@ TestFailedException::TestFailedException():Exception(){}
// which the failure should have occurred but didn't, and a
// message explaining why it should fail.
// Parameters
-// func_name - IN: Name of the function where failure should occur
-// message - IN: Message
+// func - IN: Name of the function where failure should occur
+// message - IN: Message
//--------------------------------------------------------------------------
-TestFailedException::TestFailedException(const H5std_string func_name, const H5std_string message) : Exception(func_name, message) {}
+TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: TestFailedException destructor
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp
index a6cbae4..5d78b3c 100644
--- a/c++/test/tarray.cpp
+++ b/c++/test/tarray.cpp
@@ -269,7 +269,8 @@ static void test_array_compound_array()
file1.close();
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_array_compound_array", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -343,7 +344,8 @@ static void test_array_assignment()
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_array_assignment", __LINE__, __FILE__, E.getCDetailMsg());
}
} // end test_array_assignment()
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index 0fefe22..d20466e 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -164,7 +164,7 @@ static void test_attr_basic_write()
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset");
}
- catch (AttributeIException E) // catching invalid creating attribute
+ catch (AttributeIException& E) // catching invalid creating attribute
{} // do nothing, exception expected
// Write attribute information
@@ -223,7 +223,7 @@ static void test_attr_basic_write()
throw InvalidActionException("H5Group::createAttribute",
"Attempting to create an existing attribute");
}
- catch (AttributeIException E) // catching invalid creating attribute
+ catch (AttributeIException& E) // catching invalid creating attribute
{} // do nothing, exception expected
// Write attribute information
@@ -237,7 +237,8 @@ static void test_attr_basic_write()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_basic_write()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_basic_write()
@@ -371,7 +372,8 @@ static void test_attr_getname()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_getname()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_getname()
@@ -481,7 +483,8 @@ static void test_attr_rename()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_rename()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_rename()
@@ -549,7 +552,8 @@ static void test_attr_basic_read()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_basic_read()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_basic_read()
@@ -599,7 +603,7 @@ static void test_attr_compound_write()
try {
Attribute invalid_attr = dataset.createAttribute (ATTR4_NAME, comp_type, sid2);
}
- catch (AttributeIException E) // catching invalid creating attribute
+ catch (AttributeIException& E) // catching invalid creating attribute
{} // do nothing, exception expected
// Write complex attribute data
@@ -608,7 +612,8 @@ static void test_attr_compound_write()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_compound_write()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_compound_write()
@@ -743,7 +748,8 @@ static void test_attr_compound_read()
verify_val(attr_name, ATTR4_NAME, "Attribute::getName", __LINE__, __FILE__);
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_compound_read()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -758,7 +764,8 @@ static void test_attr_compound_read()
PASSED();
} // end try block
- catch (FileIException E) {
+ catch (FileIException& E)
+ {
issue_fail_msg("test_attr_compound_read()", __LINE__, __FILE__, "Unable to truncate file, possibly because some objects are left opened");
}
} // test_attr_compound_read()
@@ -803,7 +810,7 @@ static void test_attr_scalar_write()
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset");
}
- catch (AttributeIException E) // catching invalid creating attribute
+ catch (AttributeIException& E) // catching invalid creating attribute
{} // do nothing, exception expected
// Write attribute information
@@ -812,7 +819,8 @@ static void test_attr_scalar_write()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_scalar_write()
@@ -856,7 +864,8 @@ static void test_attr_scalar_read()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_scalar_read()
@@ -919,7 +928,7 @@ static void test_attr_mult_write()
// continuation here, that means no exception has been thrown
throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute");
}
- catch (AttributeIException E) // catching invalid creating attribute
+ catch (AttributeIException& E) // catching invalid creating attribute
{} // do nothing, exception expected
// Write 3rd attribute information
@@ -928,7 +937,8 @@ static void test_attr_mult_write()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_mult_write()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_mult_write()
@@ -1118,7 +1128,8 @@ static void test_attr_mult_read()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_mult_read()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_mult_read()
@@ -1154,7 +1165,7 @@ static void test_attr_delete()
// Verify the name of the only file attribute left
Attribute fattr = fid1.openAttribute((unsigned)0);
- H5std_string attr_name = fattr.getName();
+ attr_name = fattr.getName();
verify_val(attr_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__);
fattr.close();
@@ -1174,7 +1185,7 @@ static void test_attr_delete()
// continuation here, that means no exception has been thrown
throw InvalidActionException("DataSet::removeAttr", "Attempting to remove non-existing attribute");
}
- catch (AttributeIException E) // catching invalid removing attribute
+ catch (AttributeIException& E) // catching invalid removing attribute
{} // do nothing, exception expected
// Test deleting dataset's attributes
@@ -1235,7 +1246,8 @@ static void test_attr_delete()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_delete()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_delete()
@@ -1392,7 +1404,8 @@ static void test_attr_dtype_shared()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_dtype_shared()
@@ -1516,7 +1529,8 @@ static void test_string_attr()
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_string_attr()
@@ -1560,10 +1574,12 @@ static void test_attr_exists()
PASSED();
} // end try block
- catch (InvalidActionException E) {
+ catch (InvalidActionException& E)
+ {
issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg());
}
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_exists()
@@ -1622,8 +1638,8 @@ static void test_attr_dense_create(FileCreatPropList& fcpl,
// Retrieve limits for compact/dense attribute storage and verify them
dcpl.getAttrPhaseChange(max_compact, min_dense);
- verify_val(max_compact, 7, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__);
- verify_val(min_dense, 5, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__);
+ verify_val(max_compact, static_cast<unsigned>(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__);
+ verify_val(min_dense, static_cast<unsigned>(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__);
// Close property list
dcpl.close();
@@ -1665,13 +1681,14 @@ static void test_attr_dense_create(FileCreatPropList& fcpl,
// continuation here, that means no exception has been thrown
throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached");
}
- catch (AttributeIException E) // catching invalid action
+ catch (AttributeIException& E) // catching invalid action
{} // do nothing, exception expected
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_dense_create()
@@ -1708,7 +1725,7 @@ static void test_attr_corder_create_basic(FileCreatPropList& fcpl,
// continuation here, that means no exception has been thrown
throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required");
}
- catch (PropListIException E) // catching invalid action
+ catch (PropListIException& E) // catching invalid action
{} // do nothing, exception expected
// Set attribute creation order tracking & indexing for object then
@@ -1755,7 +1772,8 @@ static void test_attr_corder_create_basic(FileCreatPropList& fcpl,
PASSED();
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr_corder_create_basic()
@@ -1845,7 +1863,8 @@ void test_attr()
} // end for
} // end try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_attr()
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index de4a9b8..e293ded 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -78,8 +78,8 @@ static void test_compound_1()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_1 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_compound_1()
@@ -200,8 +200,8 @@ static void test_compound_2()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_2 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -322,8 +322,8 @@ static void test_compound_3()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_3 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -454,8 +454,8 @@ static void test_compound_4()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_4 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -558,8 +558,8 @@ static void test_compound_5()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_5 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -655,8 +655,8 @@ static void test_compound_6()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_6 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_compound_6()
@@ -714,7 +714,7 @@ static void test_compound_7()
tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE);
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type.");
- } catch (DataTypeIException err) {}
+ } catch (DataTypeIException& err) {}
/* Release resources */
tid1.close();
@@ -722,8 +722,8 @@ static void test_compound_7()
PASSED();
} // end of try block
- catch (Exception E) {
-cerr << "test_compound_7 in catch" << endl;
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_compound_7()
@@ -812,7 +812,8 @@ static void test_compound_set_size()
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_compound_set_size()
diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp
index 5c1d953..ab93c26 100644
--- a/c++/test/tdspl.cpp
+++ b/c++/test/tdspl.cpp
@@ -114,7 +114,8 @@ static void test_transfplist()
PASSED();
}
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg());
}
}
diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp
index 16648c9..dbf7e3e 100644
--- a/c++/test/testhdf5.cpp
+++ b/c++/test/testhdf5.cpp
@@ -110,7 +110,7 @@ Comment out tests that are not done yet */
AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL);
*/
}
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("Tests failed", __LINE__, __FILE__, E.getCDetailMsg());
}
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 78b3611..b40b34c 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -116,7 +116,7 @@ static void test_file_create()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "Attempted to create an existing file.");
}
- catch( FileIException E ) // catch truncating existing file
+ catch (FileIException& E) // catch truncating existing file
{} // do nothing, FAIL expected
// Close file1
@@ -131,7 +131,7 @@ static void test_file_create()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "File already exists.");
}
- catch( FileIException E ) // catching creating existing file
+ catch (FileIException& E) // catching creating existing file
{} // do nothing, FAIL expected
// Test create with H5F_ACC_TRUNC. This will truncate the existing file.
@@ -145,7 +145,7 @@ static void test_file_create()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file.");
}
- catch( FileIException E ) // catching truncating opened file
+ catch (FileIException& E) // catching truncating opened file
{} // do nothing, FAIL expected
// Try with H5F_ACC_EXCL. This should fail too because the file already
@@ -156,7 +156,7 @@ static void test_file_create()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file.");
}
- catch( FileIException E ) // catching H5F_ACC_EXCL on existing file
+ catch (FileIException& E) // catching H5F_ACC_EXCL on existing file
{} // do nothing, FAIL expected
// Get the file-creation template
@@ -181,7 +181,7 @@ static void test_file_create()
// Close first file
delete file1;
}
- catch (InvalidActionException E)
+ catch (InvalidActionException& E)
{
cerr << " *FAILED*" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
@@ -189,7 +189,7 @@ static void test_file_create()
delete file1;
}
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
if (file1 != NULL) // clean up
@@ -268,7 +268,7 @@ static void test_file_create()
PASSED();
}
// catch all exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
if (tmpl1 != NULL) // clean up
@@ -336,7 +336,7 @@ static void test_file_open()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "Attempt truncating an opened file.");
}
- catch( FileIException E ) // catching H5F_ACC_TRUNC on opened file
+ catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file
{} // do nothing, FAIL expected
// Now, really close the file.
@@ -353,7 +353,8 @@ static void test_file_open()
PASSED();
} // end of try block
- catch( Exception E ) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_file_open()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_file_open()
@@ -411,7 +412,8 @@ static void test_file_size()
PASSED();
} // end of try block
- catch( Exception E ) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_file_size()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -505,7 +507,8 @@ static void test_file_name()
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -551,7 +554,7 @@ static void test_file_attribute()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute.");
}
- catch( AttributeIException E ) // catch creating existing attribute
+ catch (AttributeIException& E) // catch creating existing attribute
{} // do nothing, FAIL expected
// Create a new dataset
@@ -618,7 +621,8 @@ static void test_file_attribute()
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_file_attribute()
@@ -705,7 +709,8 @@ static void test_libver_bounds_real(
// Everything should be closed as they go out of scope
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_libver_bounds_real()", __LINE__, __FILE__, E.getCDetailMsg());
}
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index ff3901d..19549b3 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -148,7 +148,7 @@ static void test_null_filter()
} // end of try
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_null_filter()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -232,7 +232,7 @@ static void test_szip_filter(H5File& file1)
} // end of try
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_szip_filter()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -280,7 +280,7 @@ void test_filters()
test_null_filter();
test_szip_filter(file1);
}
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_filters()", __LINE__, __FILE__, E.getCDetailMsg());
}
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index b7a39b4..7ef048b 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -178,7 +178,7 @@ static void test_h5s_basic()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset");
}
- catch( DataSpaceIException E ) // Simple data space with too many dims
+ catch (DataSpaceIException& E) // Simple data space with too many dims
{} // do nothing, exception expected
/*
@@ -204,7 +204,7 @@ static void test_h5s_basic()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle");
}
- catch( FileIException E ) // catching higher dimensionality dataset
+ catch (FileIException& E) // catching higher dimensionality dataset
{} // do nothing, exception expected
// CHECK_I(ret, "H5Fclose"); // leave this here, later, fake a failure
@@ -213,13 +213,13 @@ static void test_h5s_basic()
PASSED();
} // end of try block
- catch (InvalidActionException E)
+ catch (InvalidActionException& E)
{
cerr << " FAILED" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
}
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_h5s_basic()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -283,7 +283,7 @@ static void test_h5s_scalar_write()
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -343,7 +343,7 @@ static void test_h5s_scalar_read()
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
// all the exceptions caused by negative returned values by C APIs
issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg());
@@ -399,7 +399,7 @@ static void test_h5s_null()
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -471,7 +471,7 @@ static void test_h5s_compound_scalar_write()
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
// all the exceptions caused by negative returned values by C APIs
issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg());
@@ -545,7 +545,7 @@ static void test_h5s_compound_scalar_read()
} // end if
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
// all the exceptions caused by negative returned values by C APIs
issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg());
diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp
index 33d10ea..025fedc 100644
--- a/c++/test/tlinks.cpp
+++ b/c++/test/tlinks.cpp
@@ -415,7 +415,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format)
verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__);
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -441,7 +441,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format)
PASSED();
} // end of try block
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -630,7 +630,7 @@ void test_links()
/* nerrors += external_reset_register() < 0 ? 1 : 0;
*/
}
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg());
}
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index 2381ec2..046e67a 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -148,7 +148,7 @@ static void test_get_objname()
} // try block
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_get_objname", __LINE__, __FILE__);
}
@@ -233,7 +233,7 @@ static void test_get_objname_ontypes()
PASSED();
} // end top try block
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__);
}
@@ -298,7 +298,7 @@ static void test_get_objtype()
} // try block
// catch all other exceptions
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_get_objtype", __LINE__, __FILE__);
}
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index 0331c8d..d7c237f 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -148,19 +148,19 @@ test_reference_params(void)
/* Test parameters to H5Location::reference */
try {
file1->reference(NULL, "/Group1/Dataset1");
- } catch (ReferenceException E) {} // We expect this to fail
+ } catch (ReferenceException& E) {} // We expect this to fail
try {
file1->reference(&wbuf[0], NULL);
- } catch (ReferenceException E) {} // We expect this to fail
+ } catch (ReferenceException& E) {} // We expect this to fail
try {
file1->reference(&wbuf[0], "");
- } catch (ReferenceException E) {} // We expect this to fail
+ } catch (ReferenceException& E) {} // We expect this to fail
try {
file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE);
- } catch (ReferenceException E) {} // We expect this to fail
+ } catch (ReferenceException& E) {} // We expect this to fail
try {
file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION);
- } catch (ReferenceException E) {} // We expect this to fail
+ } catch (ReferenceException& E) {} // We expect this to fail
// Close resources
dataset.close();
@@ -174,7 +174,8 @@ test_reference_params(void)
PASSED();
} // end try
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_reference_param()",__LINE__,__FILE__,
E.getCFuncName(), E.getCDetailMsg());
}
@@ -331,7 +332,7 @@ static void test_reference_obj(void)
try {
H5std_string read_comment_tmp = group.getComment(NULL);
}
- catch (Exception E) {} // We expect this to fail
+ catch (Exception& E) {} // We expect this to fail
// Close group
group.close();
@@ -362,7 +363,8 @@ static void test_reference_obj(void)
PASSED();
} // end try
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_reference_obj()",__LINE__,__FILE__,
E.getCFuncName(), E.getCDetailMsg());
}
@@ -490,7 +492,8 @@ test_reference_group(void)
PASSED();
} // end try
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_reference_group()",__LINE__,__FILE__,
E.getCFuncName(), E.getCDetailMsg());
}
@@ -778,7 +781,8 @@ test_reference_region_1D(void)
PASSED();
} // end try
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__,
E.getCFuncName(), E.getCDetailMsg());
}
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index 3139551..217b7b9 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -122,7 +122,8 @@ static void test_classes()
}
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg());
}
}
@@ -177,7 +178,8 @@ static void test_copy()
PASSED();
}
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg());
}
}
@@ -288,7 +290,8 @@ static void test_query()
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_query
@@ -331,7 +334,7 @@ static void test_transient ()
Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space));
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype.");
- } catch (AttributeIException err) {} // do nothing, failure expected
+ } catch (AttributeIException& err) {} // do nothing, failure expected
// Create a dataset from a transient datatype
// type.close(); - put trace in H5Tclose to make sure it's closed
@@ -345,7 +348,7 @@ static void test_transient ()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!");
- } catch (DataTypeIException err) {}
+ } catch (DataTypeIException& err) {}
itype.close();
// Get a copy of the dataset's datatype by applying DataType::copy()
@@ -366,7 +369,8 @@ static void test_transient ()
space.close();
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_transient", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_transient
@@ -411,7 +415,7 @@ static void test_named ()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype.");
- } catch (DataTypeIException err) {}
+ } catch (DataTypeIException& err) {}
// Copy a predefined datatype and commit the copy.
IntType itype(PredType::NATIVE_INT);
@@ -430,7 +434,8 @@ static void test_named ()
// no matching prototype
atype.commit(const_grp, "random uchar");
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group");
}
@@ -444,7 +449,7 @@ static void test_named ()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype.");
- } catch (DataTypeIException err) {}
+ } catch (DataTypeIException& err) {}
// We should not be able to re-commit a committed type
try {
@@ -452,7 +457,7 @@ static void test_named ()
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype.");
- } catch (DataTypeIException err) {} // do nothing, failure expected
+ } catch (DataTypeIException& err) {} // do nothing, failure expected
// It should be possible to define an attribute for the named type
Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space);
@@ -526,7 +531,8 @@ static void test_named ()
file.close();
PASSED();
} // end of try block
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_named", __LINE__, __FILE__, E.getCDetailMsg());
}
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 7c81a8e..6ec7f25 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -207,7 +207,8 @@ static void test_vlstring_dataset()
} // end try block
// Catch all exceptions.
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -306,7 +307,7 @@ static void test_vlstring_array_dataset()
} // end try
// Catch all exceptions.
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -427,7 +428,7 @@ static void test_vlstrings_special()
} // end try
// Catch all exceptions.
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_vlstrings_special()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -513,7 +514,7 @@ static void test_vlstring_type()
} // end try block
// Catch all exceptions.
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_vlstring_type()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -592,7 +593,7 @@ static void test_compact_vlstring()
} // end try
// Catch all exceptions.
- catch (Exception E)
+ catch (Exception& E)
{
issue_fail_msg("test_compact_vlstrings()", __LINE__, __FILE__, E.getCDetailMsg());
}
@@ -682,7 +683,8 @@ static void test_vlstring_attribute()
} // end try block
// Catch all exceptions.
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_vlstring_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_vlstring_attribute()
@@ -743,7 +745,8 @@ static void test_read_vl_string_attribute()
} // end try
// Catch all exceptions.
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_read_vl_string_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_read_vl_string_attribute
@@ -814,7 +817,8 @@ static void test_vlstring_array_attribute()
} // end try block
// Catch all exceptions.
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_vlstring_array_attribute()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_vlstring_array_attribute()
@@ -829,10 +833,10 @@ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space,
dset.write(&data, type, space, space);
dset.close();
} // end try
- catch (FileIException ferr) {
+ catch (FileIException& ferr) {
throw;
}
- catch (DataSetIException derr) {
+ catch (DataSetIException& derr) {
throw;
}
}
@@ -853,10 +857,10 @@ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space,
HDfree(data_read);
} // end try
- catch (FileIException ferr) {
+ catch (FileIException& ferr) {
throw;
}
- catch (DataSetIException derr) {
+ catch (DataSetIException& derr) {
throw;
}
}
@@ -936,7 +940,8 @@ static void test_vl_rewrite()
} // end try
// Catch all exceptions.
- catch (Exception E) {
+ catch (Exception& E)
+ {
issue_fail_msg("test_vl_rewrite()", __LINE__, __FILE__, E.getCDetailMsg());
}
} // end test_vl_rewrite()