From: Yann Collet Date: Mon, 1 Aug 2016 14:25:58 +0000 (+0200) Subject: added : resilience test for ZSTD_getErrorName() X-Git-Tag: v0.8.1^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a69ec4f3bf3b3796e0c9a1456363040b85f6282;p=thirdparty%2Fzstd.git added : resilience test for ZSTD_getErrorName() --- diff --git a/programs/fuzzer.c b/programs/fuzzer.c index cb31dc431..be36d74bb 100644 --- a/programs/fuzzer.c +++ b/programs/fuzzer.c @@ -132,6 +132,16 @@ static int basicUnitTests(U32 seed, double compressibility) RDG_genBuffer(CNBuffer, CNBuffSize, compressibility, 0., seed); /* Basic tests */ + DISPLAYLEVEL(4, "test%3i : ZSTD_getErrorName : ", testNb++); + { const char* errorString = ZSTD_getErrorName(0); + DISPLAYLEVEL(4, "OK : %s \n", errorString); + } + + DISPLAYLEVEL(4, "test%3i : ZSTD_getErrorName with wrong value : ", testNb++); + { const char* errorString = ZSTD_getErrorName(499); + DISPLAYLEVEL(4, "OK : %s \n", errorString); + } + DISPLAYLEVEL(4, "test%3i : compress %u bytes : ", testNb++, (U32)CNBuffSize); CHECKPLUS(r, ZSTD_compress(compressedBuffer, ZSTD_compressBound(CNBuffSize), CNBuffer, CNBuffSize, 1),