diff options
author | Albert Cheng <acheng@hdfgroup.org> | 1998-05-28 23:02:29 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 1998-05-28 23:02:29 (GMT) |
commit | 1327f0c65ecaa72a0e8983f6a0574cc9b802f130 (patch) | |
tree | cea0d53dd380e5ec5503e29f87a49631cb0476b8 /test/dsets.c | |
parent | 2a4d82a6ce3f16b916bb78717f199a160ca0ec1c (diff) | |
download | hdf5-1327f0c65ecaa72a0e8983f6a0574cc9b802f130.zip hdf5-1327f0c65ecaa72a0e8983f6a0574cc9b802f130.tar.gz hdf5-1327f0c65ecaa72a0e8983f6a0574cc9b802f130.tar.bz2 |
[svn-r402] Added cleanup function that removes all temporary test files when
the tests pass. Should add a "noclean" option that allows the
temporary to stay around even when the tests pass.
Diffstat (limited to 'test/dsets.c')
-rw-r--r-- | test/dsets.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/dsets.c b/test/dsets.c index c532954..a6d86fa 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -32,6 +32,7 @@ #define AT() printf (" at %s:%d in %s()...\n", \ __FILE__, __LINE__, __FUNCTION__); +#define TEST_FILE_NAME "dataset.h5" #define DSET_DEFAULT_NAME "default" #define DSET_CHUNKED_NAME "chunked" #define DSET_SIMPLE_IO_NAME "simple_io" @@ -671,6 +672,26 @@ test_compression(hid_t file) } /*------------------------------------------------------------------------- + * Function: cleanup + * + * Purpose: Cleanup temporary test files + * + * Return: none + * + * Programmer: Albert Cheng + * May 28, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +cleanup(void) +{ + remove(TEST_FILE_NAME); +} + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Tests the dataset interface (H5D) @@ -699,8 +720,7 @@ main(void) /* Automatic error reporting to standard output */ H5Eset_auto (display_error_cb, NULL); - unlink("dataset.h5"); - file = H5Fcreate("dataset.h5", H5F_ACC_TRUNC|H5F_ACC_DEBUG, + file = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC|H5F_ACC_DEBUG, H5P_DEFAULT, H5P_DEFAULT); assert(file >= 0); @@ -733,5 +753,6 @@ main(void) status = H5close (); assert (status>=0); + cleanup(); return 0; } |