diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2004-01-23 06:29:55 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2004-01-23 06:29:55 (GMT) |
commit | be0a322db3a240c507c495659da764434832d9be (patch) | |
tree | 183bd99241341214bcdc190f48d6b47bcaf8c473 /test/testframe.c | |
parent | 36ad158dd24cea007575246ee86a24e8994dcf41 (diff) | |
download | hdf5-be0a322db3a240c507c495659da764434832d9be.zip hdf5-be0a322db3a240c507c495659da764434832d9be.tar.gz hdf5-be0a322db3a240c507c495659da764434832d9be.tar.bz2 |
[svn-r8099] Purpose:
Added the function ParseTestVerbosity() to be shared by all programs.
Platforms tested:
Eirene.
Diffstat (limited to 'test/testframe.c')
-rw-r--r-- | test/testframe.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/test/testframe.c b/test/testframe.c index 569695c..af47dab 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -164,14 +164,7 @@ void TestParseCmdLine(int argc, char *argv[], int *Summary, int *CleanUp) for (CLLoop = 1; CLLoop < argc; CLLoop++) { if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) || (HDstrcmp(argv[CLLoop], "-v") == 0))) { - if (argv[CLLoop + 1][0] == 'l') - SetTestVerbosity(VERBO_LO); - else if (argv[CLLoop + 1][0] == 'm') - SetTestVerbosity(VERBO_MED); - else if (argv[CLLoop + 1][0] == 'h') - SetTestVerbosity(VERBO_HI); - else - SetTestVerbosity(atoi(argv[CLLoop + 1])); + ParseTestVerbosity(argv[CLLoop + 1]); } /* end if */ if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-summary") == 0) || (HDstrcmp(argv[CLLoop], "-s") == 0))) @@ -315,6 +308,23 @@ int SetTestVerbosity(int newval) return(oldval); } +/* + * Parse an argument string for verbosity level and set it. + */ +void ParseTestVerbosity(char *argv) +{ + printf("argv = %s\n", argv); + if (*argv == 'l') + SetTestVerbosity(VERBO_LO); + else if (*argv == 'm') + SetTestVerbosity(VERBO_MED); + else if (*argv == 'h') + SetTestVerbosity(VERBO_HI); + else + SetTestVerbosity(atoi(argv)); + printf("Verbosity = %d\n", GetTestVerbosity()); +} + /* * Retrieve the number of testing errors for the testing framework |