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/links.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/links.c')
-rw-r--r-- | test/links.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/links.c b/test/links.c index ac4a3e1..81c185d 100644 --- a/test/links.c +++ b/test/links.c @@ -9,6 +9,28 @@ */ #include <hdf5.h> +#define TEST_FILE_NAME "links.h5" + + +/*------------------------------------------------------------------------- + * 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 @@ -33,7 +55,7 @@ main (void) hsize_t size[1] = {1}; /* Create a file */ - file = H5Fcreate ("links.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file = H5Fcreate (TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); scalar = H5Screate_simple (1, size, size); /* Create a group */ @@ -59,5 +81,6 @@ main (void) /* Close */ H5Sclose (scalar); H5Fclose (file); + cleanup(); return 0; } |