bench.c: fixed MAX_CLEVEL

This commit is contained in:
Przemyslaw Skibinski 2016-11-21 16:37:56 +01:00
parent de4b4fc36f
commit 5ddcd9d9ae

View File

@ -483,12 +483,18 @@ static void BMK_syntheticTest(int cLevel, int cLevelLast, double compressibility
free(srcBuffer);
}
#define ZSTD_MAX_CLEVEL 22
int BMK_benchFiles(const char** fileNamesTable, unsigned nbFiles,
const char* dictFileName, int cLevel, int cLevelLast)
{
double const compressibility = (double)g_compressibilityDefault / 100;
if (cLevel > ZSTD_MAX_CLEVEL) cLevel = ZSTD_MAX_CLEVEL;
if (cLevelLast > ZSTD_MAX_CLEVEL) cLevelLast = ZSTD_MAX_CLEVEL;
if (cLevelLast < cLevel) cLevelLast = cLevel;
if (cLevelLast > cLevel) DISPLAYLEVEL(2, "Benchmarking levels from %d to %d\n", cLevel, cLevelLast);
if (nbFiles == 0)
BMK_syntheticTest(cLevel, cLevelLast, compressibility);
else