summaryrefslogtreecommitdiffstats
path: root/c++/test/tfile.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2016-04-22 11:22:34 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2016-04-22 11:22:34 (GMT)
commitc37607eb58994041cbeaabdab5f1e9902794a3e9 (patch)
treeb96792d17d5bce03ad862b556f137a7b06c1449d /c++/test/tfile.cpp
parentc63f96d6e78cfe98de8001b662ec685467fd65df (diff)
downloadhdf5-c37607eb58994041cbeaabdab5f1e9902794a3e9.zip
hdf5-c37607eb58994041cbeaabdab5f1e9902794a3e9.tar.gz
hdf5-c37607eb58994041cbeaabdab5f1e9902794a3e9.tar.bz2
[svn-r29759] 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 Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test/tfile.cpp')
-rw-r--r--c++/test/tfile.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index f84ce3a..4ff15ce 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
@@ -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
@@ -505,7 +505,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 +552,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 +619,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 +707,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());
}