zwrapbench: improved tests with a dictionary

This commit is contained in:
inikep
2016-09-26 22:11:55 +02:00
parent c941d396c0
commit a03b7a7f1b
2 changed files with 24 additions and 7 deletions
+4 -5
View File
@@ -231,13 +231,12 @@ ZEXTERN int ZEXPORT z_deflateSetDictionary OF((z_streamp strm,
LOG_WRAPPERC("- deflateSetDictionary level=%d\n", (int)zwc->compressionLevel);
if (!zwc) return Z_STREAM_ERROR;
if (zwc->zbc == NULL) {
int res;
zwc->zbc = ZSTD_createCStream_advanced(zwc->customMem);
if (zwc->zbc == NULL) return ZWRAPC_finishWithError(zwc, strm, res);
res = ZWRAP_initializeCStream(zwc, dictionary, dictLength, 0);
if (res != Z_OK) return ZWRAPC_finishWithError(zwc, strm, res);
zwc->comprState = Z_NEED_DICT;
if (zwc->zbc == NULL) return ZWRAPC_finishWithError(zwc, strm, 0);
}
{ int res = ZWRAP_initializeCStream(zwc, dictionary, dictLength, 0);
if (res != Z_OK) return ZWRAPC_finishWithError(zwc, strm, res); }
zwc->comprState = Z_NEED_DICT;
}
return Z_OK;