summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2004-01-05 21:58:37 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2004-01-05 21:58:37 (GMT)
commitdc458e5f6f7f4ea69644653aa3f348d2f6eb9d53 (patch)
treea5757b2575f4116a6470d242a94c5a612b1e7924 /test/h5test.c
parente076771380e248497a7dd8eac37319a030c99db6 (diff)
downloadhdf5-dc458e5f6f7f4ea69644653aa3f348d2f6eb9d53.zip
hdf5-dc458e5f6f7f4ea69644653aa3f348d2f6eb9d53.tar.gz
hdf5-dc458e5f6f7f4ea69644653aa3f348d2f6eb9d53.tar.bz2
[svn-r8017] Purpose:
Code reorg. Description: Move the InitTest() from individual tests (testhdf5 and ttsafe) to libh5test (h5test.c) so that it can be shared among all tests. Platforms tested: Only tested in Eirene via serial with thread-safe enabled. No other platforms test since this is pretty trivial.
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/h5test.c b/test/h5test.c
index a361bcc..87a8a0b 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -796,3 +796,23 @@ h5_get_file_size(const char *filename)
return(0);
} /* end get_file_size() */
+
+/*
+ * Setup a test function. It must have no parameters and returns void.
+ */
+void
+InitTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), const char *TheDescr)
+{
+ if (Index >= MAXNUMOFTESTS) {
+ printf("Uh-oh, too many tests added, increase MAXNUMOFTEST!\n");
+ exit(-1);
+ } /* end if */
+ HDstrcpy(Test[Index].Description, TheDescr);
+ HDstrcpy(Test[Index].Name, TheName);
+ Test[Index].Call = TheCall;
+ Test[Index].Cleanup = Cleanup;
+ Test[Index].NumErrors = -1;
+ Test[Index].SkipFlag = 0;
+ Index++;
+}
+