summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-09-10 00:08:27 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-09-10 00:08:27 (GMT)
commitdd4203674a35d499e8c21980048e4149032cfdf9 (patch)
treee55e30e9419bca1fa2d096ed4840f54fb51fb2c2 /test/h5test.c
parent32bdf68ff8c0aeac735f28c4712261990f81612c (diff)
downloadhdf5-dd4203674a35d499e8c21980048e4149032cfdf9.zip
hdf5-dd4203674a35d499e8c21980048e4149032cfdf9.tar.gz
hdf5-dd4203674a35d499e8c21980048e4149032cfdf9.tar.bz2
[svn-r2531] Description:
The "FILENAME" declared extern in h5test.h is not always used. It was used in h5_cleanup to remove temporary files created during tests. Not all tests codes have used this routine. Indeed, quite a few of test programs do "#define FILENAME ". Also, h5_cleanup needs to work in tandem with h5_fixname. h5_fixname accepts an explicite base_name argument instead of using the global variable FILENAME. That is cleaner. Solution: Added char *base_name[] as a new argument to h5_cleanup, in the same style as h5_fixname. Removed "extern char *FILENAME..." from use. Also, undo some unnecessary declaration of "char *FILENAME" from some tests which don't use it at all (yet). Platforms tested: modi4-64(irix64), arabica(solari2.7), eirene(linux) (arabica could not launch tests automatically. I had to hack in LD_LIBRARY_PATH to make them run.)
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/h5test.c b/test/h5test.c
index e052c40..0e4b785 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -96,9 +96,9 @@ h5_errors(void UNUSED *client_data)
/*-------------------------------------------------------------------------
* Function: h5_cleanup
*
- * Purpose: Cleanup temporary test files. The list of test files is in
- * `extern const char *FILENAMES[]' -- these are only the base
- * names. The file access property list is also closed.
+ * Purpose: Cleanup temporary test files.
+ * base_name contains the list of test file names.
+ * The file access property list is also closed.
*
* Return: Non-zero if cleanup actions were performed; zero otherwise.
*
@@ -106,11 +106,14 @@ h5_errors(void UNUSED *client_data)
* May 28, 1998
*
* Modifications:
+ * Albert Cheng, 2000-09-09
+ * Added the explicite base_name argument to replace the
+ * global variable FILENAME.
*
*-------------------------------------------------------------------------
*/
int
-h5_cleanup(hid_t fapl)
+h5_cleanup(const char *base_name[], hid_t fapl)
{
char filename[1024];
char temp[2048];
@@ -119,8 +122,8 @@ h5_cleanup(hid_t fapl)
hid_t driver;
if (!getenv("HDF5_NOCLEANUP")) {
- for (i=0; FILENAME[i]; i++) {
- if (NULL==h5_fixname(FILENAME[i], fapl, filename,
+ for (i=0; base_name[i]; i++) {
+ if (NULL==h5_fixname(base_name[i], fapl, filename,
sizeof filename)) {
continue;
}
@@ -201,7 +204,8 @@ h5_reset(void)
* counting the null terminator). The full name is created by
* prepending the contents of HDF5_PREFIX (separated from the
* base name by a slash) and appending a file extension based on
- * the driver supplied.
+ * the driver supplied, resulting in something like
+ * `ufs:/u/matzke/test.h5'.
*
* Return: Success: The FULLNAME pointer.
*