summaryrefslogtreecommitdiffstats
path: root/test/ttsafe.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/ttsafe.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/ttsafe.c')
-rw-r--r--test/ttsafe.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/test/ttsafe.c b/test/ttsafe.c
index 8d95d3e..276b757 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -42,6 +42,7 @@
#include <stdarg.h>
+#include "h5test.h"
#include "ttsafe.h"
#ifndef H5_HAVE_THREADSAFE
@@ -52,49 +53,20 @@ int main(void)
}
#else
-#define MAXNUMOFTESTS 50
#define HDF5_TEST_MASTER
#define MAX_NUM_NAME 1000
#define NAME_OFFSET 6 /* offset for "name<num>" */
-/* Internal Variables */
-static int Index = 0;
-
/* Global variables */
int num_errs = 0;
int Verbosity;
/* ANY new test needs to have a prototype in tproto.h */
-struct TestStruct {
- int NumErrors;
- char Description[64];
- int SkipFlag;
- char Name[16];
- void (*Call)(void);
- void (*Cleanup)(void);
-} Test[MAXNUMOFTESTS];
-
-static void InitTest(const char *TheName, void (*TheCall) (void),
- void (*Cleanup) (void), const char *TheDescr);
-static void usage(void);
+TestStruct Test[MAXNUMOFTESTS];
+int Index = 0;
-static void InitTest(const char *TheName, void (*TheCall) (void),
- void (*Cleanup) (void), const char *TheDescr)
-{
- if (Index >= MAXNUMOFTESTS) {
- print_func("Uh-oh, too many tests added, increase MAXNUMOFTEST!\n");
- exit(-1);
- }
-
- 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++;
-}
+static void usage(void);
static void usage(void)
{