1997-07-31 05:17:56 +08:00
|
|
|
/****************************************************************************
|
|
|
|
* NCSA HDF *
|
|
|
|
* Software Development Group *
|
|
|
|
* National Center for Supercomputing Applications *
|
|
|
|
* University of Illinois at Urbana-Champaign *
|
|
|
|
* 605 E. Springfield, Champaign IL 61820 *
|
|
|
|
* *
|
|
|
|
* For conditions of distribution and use, see the accompanying *
|
|
|
|
* hdf/COPYING file. *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This header file contains information required for testing the HDF5 library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HDF5TEST_H
|
|
|
|
#define HDF5TEST_H
|
|
|
|
|
1997-08-16 00:53:11 +08:00
|
|
|
/*
|
|
|
|
* Include required headers. This file tests internal library functions,
|
|
|
|
* so we include the private headers here.
|
|
|
|
*/
|
|
|
|
#include <H5private.h>
|
1997-12-17 05:08:59 +08:00
|
|
|
#include <H5Eprivate.h>
|
1997-07-31 05:17:56 +08:00
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
extern int num_errs;
|
|
|
|
extern int Verbosity;
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
/* Use %ld to print the value because long should cover most cases. */
|
|
|
|
/* Used to make certain a return value _is_not_ a value */
|
1998-03-01 02:19:05 +08:00
|
|
|
#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(); \
|
1997-07-31 05:17:56 +08:00
|
|
|
} while(0)
|
|
|
|
|
1998-03-01 02:19:05 +08:00
|
|
|
#define CHECK_I(ret,where) { \
|
|
|
|
if (Verbosity>9) { \
|
1997-07-31 05:17:56 +08:00
|
|
|
print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
|
1998-03-01 02:19:05 +08:00
|
|
|
(where), (int)__LINE__, __FILE__, (long)(ret)); \
|
|
|
|
} \
|
|
|
|
if ((ret)<0) { \
|
1997-08-10 00:47:25 +08:00
|
|
|
print_func ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
|
1998-03-01 02:19:05 +08:00
|
|
|
(where), (long)(ret), (int)__LINE__, __FILE__); \
|
|
|
|
H5Eprint (stdout); \
|
|
|
|
num_errs++; \
|
|
|
|
} \
|
|
|
|
H5Eclear (); \
|
1997-07-31 05:17:56 +08:00
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
1998-03-01 02:19:05 +08:00
|
|
|
#define CHECK_PTR(ret,where) { \
|
|
|
|
if (Verbosity>9) { \
|
1997-07-31 05:17:56 +08:00
|
|
|
print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
|
1998-03-01 02:19:05 +08:00
|
|
|
(where), (int)__LINE__, __FILE__, (ret)); \
|
|
|
|
} \
|
|
|
|
if (!(ret)) { \
|
1997-08-10 00:47:25 +08:00
|
|
|
print_func ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
|
1998-03-01 02:19:05 +08:00
|
|
|
(where), (int)__LINE__, __FILE__); \
|
|
|
|
H5Eprint (stdout); \
|
|
|
|
num_errs++; \
|
|
|
|
} \
|
|
|
|
H5Eclear (); \
|
1997-07-31 05:17:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Used to make certain a return value _is_ a value */
|
1998-03-01 02:19:05 +08:00
|
|
|
#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 is %ld at line %4d " \
|
|
|
|
"in %s\n", where, (long)x, (int)__LINE__, __FILE__); \
|
|
|
|
H5Eprint (stdout); \
|
|
|
|
num_errs++; \
|
|
|
|
} \
|
|
|
|
H5Eclear(); \
|
1997-07-31 05:17:56 +08:00
|
|
|
} while(0)
|
|
|
|
|
|
|
|
/* Used to document process through a test and to check for errors */
|
1998-03-01 02:19:05 +08:00
|
|
|
#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(); \
|
1997-07-31 05:17:56 +08:00
|
|
|
} while(0)
|
|
|
|
|
|
|
|
/* Used to document process through a test */
|
1997-08-30 00:59:28 +08:00
|
|
|
#define MESSAGE(V,A) {if (Verbosity>(V)) print_func A;}
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
/* definitions for command strings */
|
1998-01-17 06:23:43 +08:00
|
|
|
#define VERBOSITY_STR "Verbosity"
|
|
|
|
#define SKIP_STR "Skip"
|
|
|
|
#define TEST_STR "Test"
|
|
|
|
#define CLEAN_STR "Cleanup"
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
/* Prototypes for the support routines */
|
1998-01-17 06:23:43 +08:00
|
|
|
int print_func(const char *,...);
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
/* Prototypes for the test routines */
|
1998-01-17 06:23:43 +08:00
|
|
|
void test_metadata(void);
|
2000-05-09 07:09:09 +08:00
|
|
|
void test_tbbt(void);
|
1998-01-17 06:23:43 +08:00
|
|
|
void test_file(void);
|
|
|
|
void test_h5t(void);
|
1998-04-29 06:33:07 +08:00
|
|
|
void test_h5s(void);
|
1998-01-17 06:23:43 +08:00
|
|
|
void test_h5d(void);
|
1998-04-24 06:24:52 +08:00
|
|
|
void test_attr(void);
|
1998-07-15 05:14:12 +08:00
|
|
|
void test_select(void);
|
2000-10-20 00:42:33 +08:00
|
|
|
void test_time(void);
|
1998-10-14 05:30:49 +08:00
|
|
|
void test_reference(void);
|
1999-06-12 06:05:04 +08:00
|
|
|
void test_vltypes(void);
|
1999-09-29 08:30:47 +08:00
|
|
|
void test_vlstrings(void);
|
2000-04-06 04:51:44 +08:00
|
|
|
void test_iterate(void);
|
2000-11-10 05:47:59 +08:00
|
|
|
void test_array(void);
|
2000-11-12 08:10:08 +08:00
|
|
|
void test_genprop(void);
|
1997-07-31 05:17:56 +08:00
|
|
|
|
1998-07-03 08:57:00 +08:00
|
|
|
/* Prototypes for the cleanup routines */
|
|
|
|
void cleanup_metadata(void);
|
|
|
|
void cleanup_file(void);
|
|
|
|
void cleanup_h5s(void);
|
|
|
|
void cleanup_attr(void);
|
1998-07-15 05:14:12 +08:00
|
|
|
void cleanup_select(void);
|
2000-10-20 00:42:33 +08:00
|
|
|
void cleanup_time(void);
|
1998-10-14 05:30:49 +08:00
|
|
|
void cleanup_reference(void);
|
1999-06-12 06:05:04 +08:00
|
|
|
void cleanup_vltypes(void);
|
1999-09-29 08:30:47 +08:00
|
|
|
void cleanup_vlstrings(void);
|
2000-04-06 04:51:44 +08:00
|
|
|
void cleanup_iterate(void);
|
2000-11-10 05:47:59 +08:00
|
|
|
void cleanup_array(void);
|
2000-11-12 08:10:08 +08:00
|
|
|
void cleanup_genprop(void);
|
1998-07-03 08:57:00 +08:00
|
|
|
|
|
|
|
#endif /* HDF5cleanup_H */
|