summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-09-05 00:37:56 (GMT)
committerYann Collet <cyan@fb.com>2018-09-05 00:45:51 (GMT)
commit943fa6244a3985541bc93250d35ea4f4517fb266 (patch)
treef6e992bec3fa448c3d88725a01a20f79097de30b
parentd2d566097031e5119980eb5ebbfa47023bc33c55 (diff)
downloadlz4-943fa6244a3985541bc93250d35ea4f4517fb266.zip
lz4-943fa6244a3985541bc93250d35ea4f4517fb266.tar.gz
lz4-943fa6244a3985541bc93250d35ea4f4517fb266.tar.bz2
fix minor cast warning for C++ compilation
-rw-r--r--tests/.gitignore5
-rw-r--r--tests/roundTripTest.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index 58947f7..9aa42a0 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,5 +1,5 @@
-# test build artefacts
+# build artefacts
datagen
frametest
frametest32
@@ -14,3 +14,6 @@ checkTag
# test artefacts
tmp*
versionsTest
+
+# local tests
+afl
diff --git a/tests/roundTripTest.c b/tests/roundTripTest.c
index 2f161d8..2caa2bc 100644
--- a/tests/roundTripTest.c
+++ b/tests/roundTripTest.c
@@ -82,10 +82,10 @@ static void roundTripTest(void* resultBuff, size_t resultBuffCapacity,
int const randL = h32 % (cLevelSpan+1);
int const cLevel = minCLevel + randL;
int const realCLevel = (cLevel * 0) + 9; /* <=== Currently : only test level 9 */
- int const cSize = LZ4_compress_HC(srcBuff, compressedBuff, srcSize, compressedBuffCapacity, realCLevel);
+ int const cSize = LZ4_compress_HC((const char*)srcBuff, (char*)compressedBuff, (int)srcSize, (int)compressedBuffCapacity, realCLevel);
CONTROL_MSG(cSize == 0, "Compression error !");
- { int const dSize = LZ4_decompress_safe(compressedBuff, resultBuff, cSize, resultBuffCapacity);
+ { int const dSize = LZ4_decompress_safe((const char*)compressedBuff, (char*)resultBuff, cSize, (int)resultBuffCapacity);
CONTROL_MSG(dSize < 0, "Decompression detected an error !");
CONTROL_MSG(dSize != (int)srcSize, "Decompression corruption error : wrong decompressed size !");
}
@@ -102,7 +102,7 @@ static void roundTripTest(void* resultBuff, size_t resultBuffCapacity,
static void roundTripCheck(const void* srcBuff, size_t srcSize)
{
- size_t const cBuffSize = LZ4_compressBound(srcSize);
+ size_t const cBuffSize = LZ4_compressBound((int)srcSize);
void* const cBuff = malloc(cBuffSize);
void* const rBuff = malloc(cBuffSize);