From ff5589c091baf46f987f56ce726bd761cabbabd7 Mon Sep 17 00:00:00 2001 From: Paul Cruz Date: Tue, 20 Jun 2017 10:17:38 -0700 Subject: [PATCH] added comments for clarity --- tests/decodecorpus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index c0770fef..074ac593 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -1305,6 +1305,7 @@ cleanup: static size_t testDecodeWithDict(U32 seed, size_t dictSize) { + /* create variables */ U32 const dictID = RAND(&seed); size_t errorDetected = 0; BYTE* const fullDict = malloc(dictSize); @@ -1312,6 +1313,7 @@ static size_t testDecodeWithDict(U32 seed, size_t dictSize) return ERROR(GENERIC); } + /* generate random dictionary */ { int ret = genRandomDict(dictID, seed, dictSize, fullDict); if (ret != 0) { @@ -1319,8 +1321,12 @@ static size_t testDecodeWithDict(U32 seed, size_t dictSize) goto dictTestCleanup; } } + + { frame_t fr; + + /* generate frame */ { size_t const dictContentSize = dictSize-dictSize/4; BYTE* const dictContent = fullDict+dictSize/4; @@ -1328,6 +1334,7 @@ static size_t testDecodeWithDict(U32 seed, size_t dictSize) seed = generateFrame(seed, &fr, info); } + /* manually decompress and check difference */ { ZSTD_DCtx* const dctx = ZSTD_createDCtx(); {