summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-09-18 23:52:02 (GMT)
committerYann Collet <cyan@fb.com>2018-09-18 23:52:02 (GMT)
commit5a10ed2f7bb6fc9bffbabb2035ff1515e21bf25c (patch)
tree39084e05bdfd5f391d229b7ffff79ada08378d97 /tests
parent697bd904b256e9927b65d23e187adb5dddf39399 (diff)
downloadlz4-5a10ed2f7bb6fc9bffbabb2035ff1515e21bf25c.zip
lz4-5a10ed2f7bb6fc9bffbabb2035ff1515e21bf25c.tar.gz
lz4-5a10ed2f7bb6fc9bffbabb2035ff1515e21bf25c.tar.bz2
added cppcheck
as Makefile target and Travis CI test. Fixed last cppcheck warnings in tests and examples
Diffstat (limited to 'tests')
-rw-r--r--tests/frametest.c4
-rw-r--r--tests/fullbench.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/frametest.c b/tests/frametest.c
index 4efeb6f..5714732 100644
--- a/tests/frametest.c
+++ b/tests/frametest.c
@@ -520,7 +520,7 @@ int basicTests(U32 seed, double compressibility)
LZ4F_CDict* const cdict = LZ4F_createCDict(CNBuffer, dictSize);
if (cdict == NULL) goto _output_error;
CHECK( LZ4F_createCompressionContext(&cctx, LZ4F_VERSION) );
-
+
DISPLAYLEVEL(3, "LZ4F_compressFrame_usingCDict, with NULL dict : ");
CHECK_V(cSizeNoDict,
LZ4F_compressFrame_usingCDict(cctx, compressedBuffer, dstCapacity,
@@ -840,7 +840,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
size_t const iSize = MIN(sampleMax, (size_t)(iend-ip));
size_t const oSize = LZ4F_compressBound(iSize, prefsPtr);
cOptions.stableSrc = ((FUZ_rand(&randState) & 3) == 1);
- DISPLAYLEVEL(6, "Sending %zi bytes to compress (stableSrc:%u) \n",
+ DISPLAYLEVEL(6, "Sending %zu bytes to compress (stableSrc:%u) \n",
iSize, cOptions.stableSrc);
result = LZ4F_compressUpdate(cCtx, op, oSize, ip, iSize, &cOptions);
diff --git a/tests/fullbench.c b/tests/fullbench.c
index fd1202d..4b4e921 100644
--- a/tests/fullbench.c
+++ b/tests/fullbench.c
@@ -367,7 +367,6 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
size_t readSize;
int compressedBuffSize;
U32 crcOriginal;
- size_t errorCode;
/* Check file existence */
if (inFile==NULL) { DISPLAY( "Pb opening %s\n", inFileName); return 11; }
@@ -561,7 +560,7 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break;
#endif
case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress";
- errorCode = LZ4F_compressFrame(compressed_buff, compressedBuffSize, orig_buff, benchedSize, NULL);
+ { size_t const errorCode = LZ4F_compressFrame(compressed_buff, compressedBuffSize, orig_buff, benchedSize, NULL);
if (LZ4F_isError(errorCode)) {
DISPLAY("Error while preparing compressed frame\n");
free(orig_buff);
@@ -573,6 +572,7 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
chunkP[0].compressedSize = (int)errorCode;
nbChunks = 1;
break;
+ }
default :
continue; /* skip if unknown ID */
}