summaryrefslogtreecommitdiffstats
path: root/programs/frametest.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-04-12 15:40:58 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-04-12 15:40:58 (GMT)
commit2c7988761dcd7e5435c519eeffef32a90eed93ad (patch)
tree388028adaa33ddc0bd1e0901f01fbe7eb23f65fc /programs/frametest.c
parent42e5bc4a9dab26a9d1fbc9899e107b3fb926233c (diff)
downloadlz4-2c7988761dcd7e5435c519eeffef32a90eed93ad.zip
lz4-2c7988761dcd7e5435c519eeffef32a90eed93ad.tar.gz
lz4-2c7988761dcd7e5435c519eeffef32a90eed93ad.tar.bz2
Shortened tests durations
Diffstat (limited to 'programs/frametest.c')
-rw-r--r--programs/frametest.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/programs/frametest.c b/programs/frametest.c
index 6204d7a..60cd765 100644
--- a/programs/frametest.c
+++ b/programs/frametest.c
@@ -726,7 +726,7 @@ int FUZ_usage(void)
DISPLAY( "\n");
DISPLAY( "Arguments :\n");
DISPLAY( " -i# : Nb of tests (default:%u) \n", nbTestsDefault);
- DISPLAY( " -T# : Duration of tests (default: use Nb of tests) \n");
+ DISPLAY( " -T# : Duration of tests, in seconds (default: use Nb of tests) \n");
DISPLAY( " -s# : Select seed (default:prompt user)\n");
DISPLAY( " -t# : Select starting test number (default:0)\n");
DISPLAY( " -p# : Select compressibility in %% (default:%i%%)\n", FUZ_COMPRESSIBILITY_DEFAULT);
@@ -800,26 +800,23 @@ int main(int argc, char** argv)
case 'T':
argument++;
nbTests = 0; duration = 0;
-
for (;;)
{
- if (argument[0]=='m')
- {
- duration *= 60;
- argument++;
- continue;
- }
- if (argument[0]=='n')
- {
- argument++;
- continue;
- }
- if ((*argument>='0') && (*argument<='9'))
+ switch(*argument)
{
- duration *= 10;
- duration += *argument - '0';
- argument++;
- continue;
+ case 'm': duration *= 60; argument++; continue;
+ case 's':
+ case 'n': argument++; continue;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': duration *= 10; duration += *argument++ - '0'; continue;
}
break;
}