summaryrefslogtreecommitdiffstats
path: root/c++/test/h5cpputil.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-01-16 15:23:34 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-01-16 15:23:34 (GMT)
commitdfd0b59ae63ee79c8c135d0c05fe65e77422701c (patch)
tree5ff50c1587a9053cc1283b826cdfb8a1b38f8090 /c++/test/h5cpputil.h
parent35985b6dbaad14e40146c0d1b04382a4f048e4d0 (diff)
downloadhdf5-dfd0b59ae63ee79c8c135d0c05fe65e77422701c.zip
hdf5-dfd0b59ae63ee79c8c135d0c05fe65e77422701c.tar.gz
hdf5-dfd0b59ae63ee79c8c135d0c05fe65e77422701c.tar.bz2
[svn-r9829] Purpose: Clean up tests
Description: + replaced "goto error" with throw exceptions + properly cleanup dynamically allocated memory in failure cases, for in some cases, the execution continues on after the failures were reported. + added test utility class InvalidActionException for when an action should cause an exception but doesn't. Platforms tested: SunOS 5.7 (arabica) Linux 2.4 (eirene) Note that there was an error due to the missing symbol H5E_LEN. To be able to test my changes, I temporarily replaced H5E_LEN in c++/src with a constant as in the C tests, before the problem can be fixed. This value doesn't effect the C++ tests at all, at this time.
Diffstat (limited to 'c++/test/h5cpputil.h')
-rw-r--r--c++/test/h5cpputil.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index 93ba1b9..df8f139 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -23,6 +23,13 @@
#ifndef _h5cpputil_h
#define _h5cpputil_h
+#ifndef H5_NO_NAMESPACE
+namespace H5 {
+#ifndef H5_NO_STD
+ using namespace std;
+#endif // H5_NO_STD
+#endif
+
#ifndef H5_NO_STD
int test_report (int, const std::string&);
using std::cerr;
@@ -50,4 +57,15 @@ template <class Type1, class Type2>
}
}
+class InvalidActionException : public Exception {
+ public:
+ InvalidActionException(const string func_name, const string message = DEFAULT_MSG);
+ InvalidActionException();
+ virtual ~InvalidActionException();
+};
+
+#ifndef H5_NO_NAMESPACE
+}
+#endif
+
#endif