diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2004-03-30 23:35:16 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2004-03-30 23:35:16 (GMT) |
commit | d7a5f94d66390f2a777e51dba2e781d7f84e0656 (patch) | |
tree | 2db9623a283851a7273b2d01096f45c06c6a3d30 /test | |
parent | c3d9b510b4e65cd32ec9708fd369d31b77d76ea6 (diff) | |
download | hdf5-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')
-rw-r--r-- | test/h5test.h | 3 | ||||
-rw-r--r-- | test/testframe.c | 10 | ||||
-rw-r--r-- | test/testhdf5.c | 36 | ||||
-rw-r--r-- | test/ttsafe.c | 8 |
4 files changed, 33 insertions, 24 deletions
diff --git a/test/h5test.h b/test/h5test.h index 1b37feb..a903349 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -115,7 +115,8 @@ H5TEST_DLL int print_func(const char *format, ...); /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), - void (*Cleanup) (void), const char *TheDescr); + void (*Cleanup) (void), const char *TheDescr, + const void *Parameters); H5TEST_DLL void TestInfo(const char *ProgName); H5TEST_DLL void TestParseCmdLine(int argc, char *argv[], int *Summary, int *CleanUp); H5TEST_DLL void PerformTests(void); 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++; diff --git a/test/testhdf5.c b/test/testhdf5.c index b368ad2..e9941de 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -46,24 +46,24 @@ main(int argc, char *argv[]) TestInit(); /* Tests are generally arranged from least to most complexity... */ - AddTest("configure", test_configure, cleanup_configure, "Configure definitions"); - AddTest("metadata", test_metadata, cleanup_metadata, "Encode/decode metadata code"); - AddTest("tbbt", test_tbbt, NULL, "Threaded, Balanced, Binary Trees"); - AddTest("tst", test_tst, NULL, "Ternary Search Trees"); - AddTest("heap", test_heap, NULL, "Memory Heaps"); - AddTest("refstr", test_refstr, NULL, "Reference Counted Strings"); - AddTest("file", test_file, cleanup_file, "Low-Level File I/O"); - AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces"); - AddTest("attr", test_attr, cleanup_attr, "Attributes"); - AddTest("select", test_select, cleanup_select, "Selections"); - AddTest("time", test_time, cleanup_time, "Time Datatypes"); - AddTest("reference", test_reference, cleanup_reference, "References"); - AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes"); - AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings"); - AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration"); - AddTest("array", test_array, cleanup_array, "Array Datatypes"); - AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties"); - AddTest("misc", test_misc, cleanup_misc, "Miscellaneous"); + AddTest("configure", test_configure, cleanup_configure, "Configure definitions", NULL); + AddTest("metadata", test_metadata, cleanup_metadata, "Encode/decode metadata code", NULL); + AddTest("tbbt", test_tbbt, NULL, "Threaded, Balanced, Binary Trees", NULL); + AddTest("tst", test_tst, NULL, "Ternary Search Trees", NULL); + AddTest("heap", test_heap, NULL, "Memory Heaps", NULL); + AddTest("refstr", test_refstr, NULL, "Reference Counted Strings", NULL); + AddTest("file", test_file, cleanup_file, "Low-Level File I/O", NULL); + AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); + AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL); + AddTest("select", test_select, cleanup_select, "Selections", NULL); + AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); + AddTest("reference", test_reference, cleanup_reference, "References", NULL); + AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); + AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); + AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); + AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL); + AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); + AddTest("misc", test_misc, cleanup_misc, "Miscellaneous", NULL); /* Display testing information */ TestInfo(argv[0]); diff --git a/test/ttsafe.c b/test/ttsafe.c index 041ceb0..f7f661a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -91,10 +91,10 @@ int main(int argc, char *argv[]) TestInit(); /* Tests are generally arranged from least to most complexity... */ - AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation"); - AddTest("error", tts_error, cleanup_error, "per-thread error stacks"); - AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test"); - AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation"); + AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); + AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); + AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); + AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); /* Display testing information */ TestInfo(argv[0]); |