]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added : resilience test for ZSTD_getErrorName()
authorYann Collet <yann.collet.73@gmail.com>
Mon, 1 Aug 2016 14:25:58 +0000 (16:25 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Mon, 1 Aug 2016 14:25:58 +0000 (16:25 +0200)
programs/fuzzer.c

index cb31dc431970db4b3924741a16dc331be0606e32..be36d74bbbd45ded8435f4d8baaec265c8b55154 100644 (file)
@@ -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),