[svn-r8084] Purpose:

Improvement.

Description:
Verbosity level were specified by numbers which are not meaningful
and prone to typos.

Solution:
Adapted the Verbosity predefined level symbols from HDF4
and changed all numberic verbosity to symbolic values.
(Still need to convert some left over macros like MESSAGE.)

Platforms tested:
Eirene.
No h5committest since this is trivial.

Misc. update:
This commit is contained in:
Albert Cheng 2004-01-22 15:57:34 -05:00
parent 618e7e7fbb
commit 7f5fd94b56
4 changed files with 48 additions and 21 deletions

View File

@ -30,6 +30,33 @@
# include <stdarg.h>
#endif
/*
* Predefined test verbosity levels.
*
* Convention:
*
* The higher the verbosity value, the more information printed.
* So, output for higher verbosity also include output of all lower
* verbosity.
*
* Value Description
* 0 None: No informational message.
* 1 "All tests passed"
* 2 Header of overall test
* 3 Default: header and results of individual test
* 4
* 5 Low: Major category of tests.
* 6
* 7 Medium: Minor category of tests such as functions called.
* 8
* 9 High: Highest level. All information.
*/
#define VERBO_NONE 0 /* None */
#define VERBO_DEF 3 /* Default */
#define VERBO_LO 5 /* Low */
#define VERBO_MED 7 /* Medium */
#define VERBO_HI 9 /* High */
/*
* This contains the filename prefix specificied as command line option for
* the parallel test files.

View File

@ -43,7 +43,7 @@ typedef struct TestStruct {
* 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 int Verbosity = VERBO_DEF; /* Default Verbosity is Low */
static TestStruct Test[MAXNUMOFTESTS];
static int Index = 0;
@ -117,7 +117,7 @@ void TestUsage(void)
{
int i;
print_func("Usage: ttsafe [-v[erbose] (l[ow]|m[edium]|h[igh]|0-10)] \n");
print_func("Usage: ttsafe [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] \n");
print_func(" [-[e]x[clude] name+] \n");
print_func(" [-o[nly] name+] \n");
print_func(" [-b[egin] name] \n");
@ -170,11 +170,11 @@ void TestParseCmdLine(int argc, char *argv[], int *Summary, int *CleanUp)
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) ||
(HDstrcmp(argv[CLLoop], "-v") == 0))) {
if (argv[CLLoop + 1][0] == 'l')
Verbosity = 4;
Verbosity = VERBO_LO;
else if (argv[CLLoop + 1][0] == 'm')
Verbosity = 6;
Verbosity = VERBO_MED;
else if (argv[CLLoop + 1][0] == 'h')
Verbosity = 10;
Verbosity = VERBO_HI;
else
Verbosity = atoi(argv[CLLoop + 1]);
} /* end if */

View File

@ -33,7 +33,7 @@
/* Used to make certain a return value _is_not_ a value */
#ifdef H5_WANT_H5_V1_6_COMPAT
#define CHECK(ret, val, where) do { \
if (GetTestVerbosity()>9) print_func(" Call to routine: %15s at line %4d " \
if (GetTestVerbosity()>=VERBO_HI) print_func(" Call to routine: %15s at line %4d " \
"in %s returned %ld \n", \
where, (int)__LINE__, __FILE__, \
(long)(ret)); \
@ -45,7 +45,7 @@
} while(0)
#define CHECK_I(ret,where) { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
(where), (int)__LINE__, __FILE__, (long)(ret)); \
} \
@ -57,7 +57,7 @@
}
#define CHECK_PTR(ret,where) { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
(where), (int)__LINE__, __FILE__, (ret)); \
} \
@ -70,7 +70,7 @@
/* Used to make certain a return value _is_ a value */
#define VERIFY(x, val, where) do { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s had value " \
"%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
} \
@ -83,11 +83,11 @@
/* Used to document process through a test and to check for errors */
#define RESULT(ret,func) do { \
if (GetTestVerbosity()>8) { \
if (GetTestVerbosity()>VERBO_MED) { \
print_func(" Call to routine: %15s at line %4d in %s returned " \
"%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
} \
if (GetTestVerbosity()>9) \
if (GetTestVerbosity()>=VERBO_HI) \
H5Eprint(stdout); \
if ((ret) == FAIL) { \
TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
@ -98,7 +98,7 @@
#else
#define CHECK(ret, val, where) do { \
if (GetTestVerbosity()>9) print_func(" Call to routine: %15s at line %4d " \
if (GetTestVerbosity()>=VERBO_HI) print_func(" Call to routine: %15s at line %4d " \
"in %s returned %ld \n", \
where, (int)__LINE__, __FILE__, \
(long)(ret)); \
@ -110,7 +110,7 @@
} while(0)
#define CHECK_I(ret,where) { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
(where), (int)__LINE__, __FILE__, (long)(ret)); \
} \
@ -122,7 +122,7 @@
}
#define CHECK_PTR(ret,where) { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
(where), (int)__LINE__, __FILE__, (ret)); \
} \
@ -135,7 +135,7 @@
/* Used to make certain a return value _is_ a value */
#define VERIFY(x, val, where) do { \
if (GetTestVerbosity()>9) { \
if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s had value " \
"%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
} \
@ -148,11 +148,11 @@
/* Used to document process through a test and to check for errors */
#define RESULT(ret,func) do { \
if (GetTestVerbosity()>8) { \
if (GetTestVerbosity()>VERBO_MED) { \
print_func(" Call to routine: %15s at line %4d in %s returned " \
"%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
} \
if (GetTestVerbosity()>9) \
if (GetTestVerbosity()>=VERBO_HI) \
H5Eprint(H5E_DEFAULT, stdout); \
if ((ret) == FAIL) { \
TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \

View File

@ -98,7 +98,7 @@ test_tbbt(void)
swap_arr(rem_arr, i, t);
} /* end for */
if (GetTestVerbosity() > 9)
if (GetTestVerbosity() >= VERBO_HI)
{
printf("ins_arr: \n");
for (i = 0; i < test_size; i++) /* print the arrays */
@ -115,12 +115,12 @@ test_tbbt(void)
MESSAGE(9, ("inserting %d\n", (int) ins_arr[i]));
H5TB_dins(tree, (void *) &ins_arr[i], NULL);
#ifdef H5TB_DEBUG
if(GetTestVerbosity()>9)
if(GetTestVerbosity() >= VERBO_HI)
H5TB_dump(tree, -1);
#endif /* H5TB_DEBUG */
}
#ifdef H5TB_DEBUG
if(GetTestVerbosity()>9)
if(GetTestVerbosity() >= VERBO_HI)
H5TB_dump(tree, -1);
#endif /* H5TB_DEBUG */
for (i = 0; i < test_size; i++)
@ -132,7 +132,7 @@ test_tbbt(void)
MESSAGE(9, ("removing %d\n", (int) key));
H5TB_rem((H5TB_NODE **) tree, (H5TB_NODE *) r, NULL);
#ifdef H5TB_DEBUG
if(GetTestVerbosity()>9)
if(GetTestVerbosity() >= VERBO_HI)
H5TB_dump(tree, -1);
#endif /* H5TB_DEBUG */
} /* end for */