diff options
author | Albert Cheng <acheng@hdfgroup.org> | 1998-07-03 00:57:00 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 1998-07-03 00:57:00 (GMT) |
commit | b81abe336d5ab6498fc6e382822a9f85be1af8e9 (patch) | |
tree | 65b9c658f2f0ceef1a520762a869110aada11313 /test/tohdr.c | |
parent | b8237b2977e2fc202da40e5ffe72f7827ba6a33d (diff) | |
download | hdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.zip hdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.tar.gz hdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.tar.bz2 |
[svn-r445] Added individually named cleanup_xxx routine to each test module file
to cleanup temporary files used by that particular module.
Added a cleanup() routine to testhdf5 that calls all the other
cleanup_xxx() routines to do cleanup.
Cleanup action can be disabled either by -c (no cleanup) option
or HDF5_NOCLEANUP environment variable.
Diffstat (limited to 'test/tohdr.c')
-rw-r--r-- | test/tohdr.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/tohdr.c b/test/tohdr.c index 386a667..4b249de 100644 --- a/test/tohdr.c +++ b/test/tohdr.c @@ -14,6 +14,7 @@ * *------------------------------------------------------------------------- */ + #include <testhdf5.h> #include <H5private.h> @@ -24,6 +25,8 @@ #include <H5Gprivate.h> #include <H5Oprivate.h> +#define TEST_FILE "tohdr.h5" + /* * This file needs to access private datatypes from the H5G package. */ @@ -59,7 +62,7 @@ test_ohdr(void) MESSAGE(5, ("Testing Object Headers\n")); /* create the file */ - fid = H5Fcreate("tohdr.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(TEST_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); f = H5I_object(fid); CHECK(f, NULL, "H5I_object"); @@ -170,3 +173,25 @@ test_ohdr(void) H5O_close(&oh_ent); H5Fclose(fid); } + + +/*------------------------------------------------------------------------- + * Function: cleanup_ohdr + * + * Purpose: Cleanup temporary test files + * + * Return: none + * + * Programmer: Albert Cheng + * July 2, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +cleanup_ohdr(void) +{ + remove(TEST_FILE); +} + |