summaryrefslogtreecommitdiffstats
path: root/c++/test/h5cpputil.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2007-03-17 16:26:53 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2007-03-17 16:26:53 (GMT)
commit1c4e6d163f781003ce1151781b3d403dc9b52e66 (patch)
treeb07834021d14510d51e90736877fd938c1a9d904 /c++/test/h5cpputil.h
parentc4bbce8be19cd60e7ffd0180194c0e0e92091381 (diff)
downloadhdf5-1c4e6d163f781003ce1151781b3d403dc9b52e66.zip
hdf5-1c4e6d163f781003ce1151781b3d403dc9b52e66.tar.gz
hdf5-1c4e6d163f781003ce1151781b3d403dc9b52e66.tar.bz2
[svn-r13524] Purpose: Cleanup tests
Description: Added extern "C" to cleanup functions as well, forgot last time. Cleaned up/Added comments to some of the newly added tests. Platforms tested AIX 5.1 (copper) Linux 2.6 (kagiso) SunOS 5.8 64-bit (sol)
Diffstat (limited to 'c++/test/h5cpputil.h')
-rw-r--r--c++/test/h5cpputil.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index bb08f45..d22a4d3 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -42,20 +42,37 @@ int test_report (int, const H5std_string&);
void issue_fail_msg(const char* where, int line, const char* file_name,
const char* message="");
+class InvalidActionException : public Exception {
+ public:
+ InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ InvalidActionException();
+ virtual ~InvalidActionException();
+};
+
+class TestFailedException : public Exception {
+ public:
+ TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ TestFailedException();
+ virtual ~TestFailedException();
+};
+
template <class Type1, class Type2>
void verify_val(Type1 x, Type2 value, const char* where, int line, const char* file_name)
{
if (GetTestVerbosity()>=VERBO_HI)
{
+ cerr << endl;
cerr << " Call to routine: " << where << " at line " << line
<< " in " << file_name << " had value " << x << endl;
}
if (x != value)
{
+ cerr << endl;
cerr << "*** UNEXPECTED VALUE from " << where << " should be "
<< value << ", but is " << x << " at line " << line
<< " in " << file_name << endl;
IncTestNumErrs();
+ throw TestFailedException(where, "");
}
}
@@ -64,10 +81,12 @@ template <class Type1, class Type2>
{
if (x != value)
{
+ cerr << endl;
cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line
<< ":" << msg << " different: " << x << ", should be " << value
<< endl;
IncTestNumErrs();
+ throw TestFailedException(file_name, msg);
}
}
@@ -76,24 +95,20 @@ template <class Type1, class Type2>
{
if (GetTestVerbosity()>=VERBO_HI)
{
+ cerr << endl;
cerr << " Call to routine: " << where << " at line " << line
<< " in " << file_name << " had value " << x << endl;
}
if (x == value)
{
+ cerr << endl;
cerr << "*** UNEXPECTED VALUE from " << where << " should not be "
<< value << " at line " << line << " in " << file_name << endl;
IncTestNumErrs();
+ throw TestFailedException(where, "");
}
}
-class InvalidActionException : public Exception {
- public:
- InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
- InvalidActionException();
- virtual ~InvalidActionException();
-};
-
/* Prototypes for the test routines */
#ifdef __cplusplus
extern "C" {
@@ -110,6 +125,7 @@ void test_vlstrings(void);
/* Prototypes for the cleanup routines */
void cleanup_attr(void);
void cleanup_compound(void);
+void cleanup_dsets(void);
void cleanup_file(void);
void cleanup_filters(void);
void cleanup_h5s(void);