summaryrefslogtreecommitdiffstats
path: root/tests/fullbench.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-10 23:31:59 (GMT)
committerYann Collet <cyan@fb.com>2016-11-10 23:31:59 (GMT)
commit1f246a98992fa7035823bedf6a0b7612fc290592 (patch)
tree2798ea12ec7cc812dfc5befbf9121939fc9d7938 /tests/fullbench.c
parent5e13a6ec469e25c7dd425c7da4518b4ad2a8862d (diff)
downloadlz4-1f246a98992fa7035823bedf6a0b7612fc290592.zip
lz4-1f246a98992fa7035823bedf6a0b7612fc290592.tar.gz
lz4-1f246a98992fa7035823bedf6a0b7612fc290592.tar.bz2
Fixed #178 fullbench on small input
Diffstat (limited to 'tests/fullbench.c')
-rw-r--r--tests/fullbench.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/fullbench.c b/tests/fullbench.c
index 975cf8a..fa37fa6 100644
--- a/tests/fullbench.c
+++ b/tests/fullbench.c
@@ -386,7 +386,7 @@ static int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSi
/* frame functions */
static int local_LZ4F_compressFrame(const char* in, char* out, int inSize)
{
- return (int)LZ4F_compressFrame(out, 2*inSize + 16, in, inSize, NULL);
+ return (int)LZ4F_compressFrame(out, LZ4F_compressFrameBound(inSize, NULL), in, inSize, NULL);
}
static LZ4F_decompressionContext_t g_dCtx;
@@ -532,9 +532,11 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
chunkP[0].origSize = (int)benchedSize; nbChunks=1;
break;
case 40: compressionFunction = local_LZ4_saveDict; compressorName = "LZ4_saveDict";
+ if (chunkP[0].origSize < 8) { DISPLAY(" cannot bench %s with less then 8 bytes \n", compressorName); continue; }
LZ4_loadDict(&LZ4_stream, chunkP[0].origBuffer, chunkP[0].origSize);
break;
case 41: compressionFunction = local_LZ4_saveDictHC; compressorName = "LZ4_saveDictHC";
+ if (chunkP[0].origSize < 8) { DISPLAY(" cannot bench %s with less then 8 bytes \n", compressorName); continue; }
LZ4_loadDictHC(&LZ4_streamHC, chunkP[0].origBuffer, chunkP[0].origSize);
break;
case 60: DISPLAY("Obsolete compression functions : \n"); continue;