summaryrefslogtreecommitdiffstats
path: root/test/testhdf5.h
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-09-24 19:26:50 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-09-24 19:26:50 (GMT)
commit7e79a8d71e6a579710e0fc2c677dfc32336d058f (patch)
treed9b4f93046b8c2930fd35b3ec75953eccf1c1a47 /test/testhdf5.h
parent52f3545bde417a7eaeb996bfc97b58ab32075c73 (diff)
downloadhdf5-7e79a8d71e6a579710e0fc2c677dfc32336d058f.zip
hdf5-7e79a8d71e6a579710e0fc2c677dfc32336d058f.tar.gz
hdf5-7e79a8d71e6a579710e0fc2c677dfc32336d058f.tar.bz2
[svn-r7507] *** empty log message ***
Diffstat (limited to 'test/testhdf5.h')
-rw-r--r--test/testhdf5.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/test/testhdf5.h b/test/testhdf5.h
index 32cbaaa..f5e51e3 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -33,6 +33,81 @@ extern int Verbosity;
/* Use %ld to print the value because long should cover most cases. */
/* Used to make certain a return value _is_not_ a value */
+#ifdef H5_WANT_H5_V1_6_COMPAT
+#define CHECK(ret, val, where) do { \
+ if (Verbosity>9) print_func(" Call to routine: %15s at line %4d " \
+ "in %s returned %ld \n", \
+ where, (int)__LINE__, __FILE__, \
+ (long)(ret)); \
+ if ((ret) == (val)) { \
+ print_func("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \
+ num_errs++; \
+ H5Eprint (stdout); \
+ } \
+ H5Eclear(); \
+} while(0)
+
+#define CHECK_I(ret,where) { \
+ if (Verbosity>9) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
+ (where), (int)__LINE__, __FILE__, (long)(ret)); \
+ } \
+ if ((ret)<0) { \
+ print_func ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
+ (where), (long)(ret), (int)__LINE__, __FILE__); \
+ H5Eprint (stdout); \
+ num_errs++; \
+ } \
+ H5Eclear (); \
+}
+
+#define CHECK_PTR(ret,where) { \
+ if (Verbosity>9) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
+ (where), (int)__LINE__, __FILE__, (ret)); \
+ } \
+ if (!(ret)) { \
+ print_func ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
+ (where), (int)__LINE__, __FILE__); \
+ H5Eprint (stdout); \
+ num_errs++; \
+ } \
+ H5Eclear (); \
+}
+
+/* Used to make certain a return value _is_ a value */
+#define VERIFY(x, val, where) do { \
+ if (Verbosity>9) { \
+ print_func(" Call to routine: %15s at line %4d in %s had value " \
+ "%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
+ } \
+ if ((x) != (val)) { \
+ print_func("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
+ "in %s\n", (where), (long)(val), (long)(x), (int)__LINE__, __FILE__); \
+ H5Eprint (stdout); \
+ num_errs++; \
+ } \
+ H5Eclear(); \
+} while(0)
+
+/* Used to document process through a test and to check for errors */
+#define RESULT(ret,func) do { \
+ if (Verbosity>8) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned " \
+ "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
+ } \
+ if (Verbosity>9) HEprint(stdout, 0); \
+ if ((ret) == FAIL) { \
+ print_func("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \
+ H5Eprint (stdout); \
+ num_errs++; \
+ } \
+ H5Eclear(); \
+} while(0)
+
+#else
#define CHECK(ret, val, where) do { \
if (Verbosity>9) print_func(" Call to routine: %15s at line %4d " \
"in %s returned %ld \n", \
@@ -106,6 +181,8 @@ extern int Verbosity;
H5Eclear(H5E_DEFAULT); \
} while(0)
+#endif /* H5_WANT_H5_V1_6_COMPAT */
+
/* Used to document process through a test */
#define MESSAGE(V,A) {if (Verbosity>(V)) print_func A;}