summaryrefslogtreecommitdiffstats
path: root/test/testframe.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-01-10 01:41:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-01-10 01:41:13 (GMT)
commit987f5d5e4de41c02b682464fa8e94252553ed57c (patch)
tree2bf74eb88dee718490af7b7dda0e585b0d1b8a95 /test/testframe.c
parent12dca9ab3c362fc190feb330232bec4bd552df3c (diff)
downloadhdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.zip
hdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.tar.gz
hdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.tar.bz2
[svn-r8048] Purpose:
Code cleanup & reorganization Description: Move further in the testing framework cleanup, eliminating all the global variables (moving them into testframe.c as static variables) from the testing framework code and moving it into the libh5test.a. Platforms tested: FreeBSD 4.9 (sleipnir) w & w/o thread-safety, c++ & parallel h5committested
Diffstat (limited to 'test/testframe.c')
-rw-r--r--test/testframe.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/test/testframe.c b/test/testframe.c
index 550ea81..ea3be51 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -40,8 +40,10 @@ typedef struct TestStruct {
/*
- * Global variables used by InitTest().
+ * Variables used by testing framework.
*/
+static int num_errs = 0; /* Total number of errors during testing */
+static int Verbosity = 4; /* Default Verbosity is Low */
static TestStruct Test[MAXNUMOFTESTS];
static int Index = 0;
@@ -296,3 +298,44 @@ void TestCleanup(void)
Test[Loop].Cleanup();
}
+
+/*
+ * Retrieve the verbosity level for the testing framework
+ */
+int GetTestVerbosity(void)
+{
+ return(Verbosity);
+}
+
+
+/*
+ * Retrieve the number of testing errors for the testing framework
+ */
+int GetTestNumErrs(void)
+{
+ return(num_errs);
+}
+
+
+/*
+ * This routine is designed to provide equivalent functionality to 'printf'
+ * and also increment the error count for the testing framework.
+ */
+int
+TestErrPrintf(const char *format, ...)
+{
+ va_list arglist;
+ int ret_value;
+
+ /* Increment the error count */
+ num_errs++;
+
+ /* Print the requested information */
+ va_start(arglist, format);
+ ret_value = vprintf(format, arglist);
+ va_end(arglist);
+
+ /* Return the length of the string produced (like printf() does) */
+ return ret_value;
+}
+