summaryrefslogtreecommitdiffstats
path: root/test/extend.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1998-05-28 23:02:29 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1998-05-28 23:02:29 (GMT)
commit1327f0c65ecaa72a0e8983f6a0574cc9b802f130 (patch)
treecea0d53dd380e5ec5503e29f87a49631cb0476b8 /test/extend.c
parent2a4d82a6ce3f16b916bb78717f199a160ca0ec1c (diff)
downloadhdf5-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/extend.c')
-rw-r--r--test/extend.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/extend.c b/test/extend.c
index 7ead138..b582cc4 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -10,11 +10,32 @@
#include <assert.h>
#include <hdf5.h>
+#define TEST_FILE_NAME "extend.h5"
#define NX 100 /* USE AN EVEN NUMBER!*/
#define NY 100 /* USE AN EVEN NUMBER!*/
/*-------------------------------------------------------------------------
+ * 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 extendible datasets
@@ -54,7 +75,7 @@ main (void)
assert (mem_space>=0);
/* Create the file */
- file = H5Fcreate ("extend.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);
@@ -126,6 +147,7 @@ main (void)
H5Dclose (dataset);
H5Fclose (file);
+ cleanup();
return 0;
}