Skip to content

Commit 3f48341

Browse files
committed
Bug fixes in test application:
- "--level=N" option didn't work - compression level was displayed incorrectly (used %c instead of %d)
1 parent 3331dda commit 3f48341

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Test/test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int main(int argc, const char **argv)
229229
arg += 2; // skip "--"
230230
if (!strnicmp(arg, "level=", 6))
231231
{
232-
if (!(level >= '0' && level <= '9')) goto usage;
232+
if (!(level < '0' || level > '9')) goto usage;
233233
level = arg[6] - '0';
234234
}
235235
else if (!strnicmp(arg, "exclude=", 8))
@@ -383,11 +383,11 @@ int main(int argc, const char **argv)
383383
float originalSizeMb = totalDataSize / double(1<<20);
384384
if (!compactOutput)
385385
{
386-
printf("Compressed %.1f Mb of data by method %s with level %c (%s)\n", originalSizeMb, method, level, dirName);
386+
printf("Compressed %.1f Mb of data by method %s with level %d (%s)\n", originalSizeMb, method, level, dirName);
387387
}
388388
else
389389
{
390-
printf("%6s:%c Data: %.1f Mb ", method, level, originalSizeMb);
390+
printf("%6s:%d Data: %.1f Mb ", method, level, originalSizeMb);
391391
}
392392
printf("Time: %-5.1f s Size: %d bytes Speed: %5.2f Mb/s Ratio: %.2f",
393393
time, totalCompressedSize, totalDataSize / double(1<<20) / time, (double)totalDataSize / totalCompressedSize);

0 commit comments

Comments
 (0)