summaryrefslogtreecommitdiffstats
path: root/test/testframe.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2004-03-30 23:35:16 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2004-03-30 23:35:16 (GMT)
commitd7a5f94d66390f2a777e51dba2e781d7f84e0656 (patch)
tree2db9623a283851a7273b2d01096f45c06c6a3d30 /test/testframe.c
parentc3d9b510b4e65cd32ec9708fd369d31b77d76ea6 (diff)
downloadhdf5-d7a5f94d66390f2a777e51dba2e781d7f84e0656.zip
hdf5-d7a5f94d66390f2a777e51dba2e781d7f84e0656.tar.gz
hdf5-d7a5f94d66390f2a777e51dba2e781d7f84e0656.tar.bz2
[svn-r8289] Purpose:
Feature Description: Added to AddTest() a generic parameters pointer argument to allow some extra parameters for some tests. E.g., test file names can be customized during runtime and passed into the test routines. Platforms tested: "h5committested". Also run compat test in eirene.
Diffstat (limited to 'test/testframe.c')
-rw-r--r--test/testframe.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/testframe.c b/test/testframe.c
index 1952ef5..f99a15f 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -36,6 +36,7 @@ typedef struct TestStruct {
char Name[MAXTESTNAME];
void (*Call)(void);
void (*Cleanup)(void);
+ void *Parameters;
} TestStruct;
@@ -51,9 +52,15 @@ static int Index = 0;
/*
* Setup a test function and add it to the list of tests.
* It must have no parameters and returns void.
+ * TheName--short test name
+ * TheCall--the test routine
+ * Cleanup--the cleanup routine for the test
+ * TheDescr--Long description of the test
+ * Parameters--pointer to extra parameters. Use NULL if none used.
+ * Since only the pointer is copied, the contents should not change.
*/
void
-AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), const char *TheDescr)
+AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), const char *TheDescr, const void *Parameters)
{
/* Sanity checking */
if (Index >= MAXNUMOFTESTS) {
@@ -79,6 +86,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
Test[Index].Cleanup = Cleanup;
Test[Index].NumErrors = -1;
Test[Index].SkipFlag = 0;
+ Test[Index].Parameters = Parameters;
/* Increment test count */
Index++;