summaryrefslogtreecommitdiffstats
path: root/c++/test/tfile.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2013-03-22 17:56:05 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2013-03-22 17:56:05 (GMT)
commitc8018386da2165a16f5e2d0cb5a391dca07b4ed5 (patch)
treebd9af146bf98c667e9237afc21bb5f108eb81dbc /c++/test/tfile.cpp
parent030a17ca60905ef90cabaa147ee84febb064fc42 (diff)
downloadhdf5-c8018386da2165a16f5e2d0cb5a391dca07b4ed5.zip
hdf5-c8018386da2165a16f5e2d0cb5a391dca07b4ed5.tar.gz
hdf5-c8018386da2165a16f5e2d0cb5a391dca07b4ed5.tar.bz2
[svn-r23427] Purpose: Fix bug HDFFV-8067
Description: + The C++ test failed with the new PGI compilers versions 12.4 and 12.5 + An exception thrown by an internal function, which was called by a constructor, was not propagating to the test program during the stack unwinding, so it couldn't be caught by the test and the program terminated. + Various trials and errors indicated that the problem is where an STD string converted to a char* being passed to the internal function, but confirmation has not been found yet. It could be a compiler bug. Solution: + Added a try/catch in the constructor around the internal function and re-throw the exception when it is caught. This is a workaround. + Unrelated minor fixes: removed unused variables and MESSAGE's; commented out tvlstr.cpp/test_read_vl_string_attribute because it may be redundant, and commented out H5Tpkg.h inclusion because TEST_ALIGNMENT is not added yet and probably not necessary in the C++ API. Platforms tested: Linux/32 2.6 (jam) with PGI compilers Linux/32 2.6 (jam) with GNU compilers Linux/64 2.6 (koala)
Diffstat (limited to 'c++/test/tfile.cpp')
-rw-r--r--c++/test/tfile.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index ba38d7a..65b8e57 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -117,16 +117,16 @@ static void test_file_create()
"terminate called without an active exception
Command terminated by signal 6"
Commenting it out until it's fixed LK 20120626.
-#ifndef H5_HAVE_FILE_VERSIONS
+*/
try {
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
+
// 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
{} // do nothing, FAIL expected
-#endif
// Close file1
delete file1;
file1 = NULL;
@@ -144,7 +144,6 @@ static void test_file_create()
// Test create with H5F_ACC_TRUNC. This will truncate the existing file.
file1 = new H5File (FILE1, H5F_ACC_TRUNC);
-#ifndef H5_HAVE_FILE_VERSIONS
// Try to truncate first file again. This should fail because file1
// is the same file and is currently open.
try {
@@ -155,19 +154,17 @@ static void test_file_create()
}
catch( FileIException E ) // catching truncating opened file
{} // do nothing, FAIL expected
-#endif
+
// Try with H5F_ACC_EXCL. This should fail too because the file already
// exists.
try {
-// H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
+ H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
// 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
{} // do nothing, FAIL expected
-*/
- std::cerr << "SKIPPED for HDFFV-8067" << std::endl;
// Get the file-creation template
FileCreatPropList tmpl1 = file1->getCreatePlist();
@@ -627,7 +624,6 @@ void test_file()
{
// Output message about test being performed
MESSAGE(5, ("Testing File I/O operations\n"));
- //MESSAGE("Testing File I/O operations\n");
test_file_create(); // Test file creation (also creation templates)
test_file_open(); // Test file opening