summaryrefslogtreecommitdiffstats
path: root/c++/test/tfile.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2001-03-09 22:15:28 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2001-03-09 22:15:28 (GMT)
commitf9d785f7de7413d73606ec3d58f7a07e289dd409 (patch)
tree2aae2f6589ed3a26566ad9be555e0f6811af7ce1 /c++/test/tfile.cpp
parente5cf05cbef1b2ebaecd03dc6ff7db09785dc8efe (diff)
downloadhdf5-f9d785f7de7413d73606ec3d58f7a07e289dd409.zip
hdf5-f9d785f7de7413d73606ec3d58f7a07e289dd409.tar.gz
hdf5-f9d785f7de7413d73606ec3d58f7a07e289dd409.tar.bz2
[svn-r3582]
Purpose: Test code improvement Description: - Added H5_HAVE_ZLIB_H and H5_HAVE_LIBZ to dsets.cpp - Added the use of new API Exception::getCFuncName to obtain the name of the function where failure occurs, to various places in the test code. Platforms tested: arabica (sparc-sun-solaris 2.7)
Diffstat (limited to 'c++/test/tfile.cpp')
-rw-r--r--c++/test/tfile.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 4acacc0..3a3cb1d 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -10,12 +10,13 @@
* Test the low-level file I/O features.
*/
-#include "H5private.h"
-#include "H5Bprivate.h"
-#include "H5Pprivate.h"
+//#include "H5private.h"
+//#include "H5Bprivate.h"
+//#include "H5Pprivate.h"
-#include "testhdf5.h"
+#include <iostream>
#include "H5Cpp.h"
+#include "testhdf5.h"
#ifndef H5_NO_NAMESPACE
using namespace H5;
@@ -60,10 +61,6 @@ using namespace H5;
static void
test_file_create(void)
{
- hid_t tmpl1, tmpl2; /*file creation templates */
- int iparm, iparm2;
- herr_t ret; /*generic return value */
-
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
@@ -72,7 +69,7 @@ test_file_create(void)
/* Create with H5F_ACC_EXCL */
/* First ensure the file does not exist */
- //remove(FILE1);
+ remove(FILE1);
try {
H5File* fid1 = new H5File (FILE1, H5F_ACC_EXCL);
@@ -137,10 +134,10 @@ test_file_create(void)
delete fid1;
}
catch( PropListIException error ) {
- CHECK(-1, FAIL, error.getCDetailMesg());
+ CHECK(-1, FAIL, error.getCFuncName());
}
catch( FileIException error ) {
- CHECK(-1, FAIL, error.getCDetailMesg());
+ CHECK(-1, FAIL, error.getCFuncName());
}
try
@@ -161,6 +158,7 @@ test_file_create(void)
/* Release file-creation template */
delete tmpl1;
+// here is still good
/* Get the file-creation template */
tmpl1 = new FileCreatPropList (fid2.getCreatePlist());
@@ -214,10 +212,7 @@ test_file_create(void)
delete tmpl1;
}
catch( PropListIException error ) {
- CHECK(-1, FAIL, error.getCDetailMesg());
- }
- catch( FileIException error ) {
- CHECK(-1, FAIL, error.getCDetailMesg());
+ CHECK(-1, FAIL, error.getCFuncName());
}
} /* test_file_create() */
@@ -266,11 +261,8 @@ test_file_open(void)
VERIFY(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk");
} // end of try block
- catch( FileIException error ) {
- CHECK(FAIL, FAIL, error.getCDetailMesg());
- }
- catch( PropListIException error ) {
- CHECK(FAIL, FAIL, error.getCDetailMesg());
+ catch( Exception error ) {
+ CHECK(FAIL, FAIL, error.getCFuncName());
}
} /* test_file_open() */