diff --git a/Makefile b/Makefile index f355891a..ac0c583f 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ zstd: cp $(PRGDIR)/zstd . zlibwrapper: - $(MAKE) -C $(ZWRAPDIR) test test_zstd + $(MAKE) -C $(ZWRAPDIR) test test: $(MAKE) -C $(TESTDIR) $@ diff --git a/zlibWrapper/Makefile b/zlibWrapper/Makefile index 46671ea6..e595a046 100644 --- a/zlibWrapper/Makefile +++ b/zlibWrapper/Makefile @@ -30,31 +30,27 @@ RM = rm -f all: clean fitblk example example_d zwrapbench -test: example fitblk +test: example fitblk example_zstd fitblk_zstd zwrapbench ./example + ./example_zstd ./fitblk 10240 <../zstd_compression_format.md ./fitblk 40960 <../zstd_compression_format.md + ./fitblk_zstd 10240 <../zstd_compression_format.md + ./fitblk_zstd 40960 <../zstd_compression_format.md ./zwrapbench -qb1e5 ../zstd_compression_format.md ./zwrapbench -qb1e5B1K ../zstd_compression_format.md test_d: example_d ./example_d -test_zstd: example_zstd fitblk_zstd zwrapbench - ./example_zstd - ./fitblk_zstd 10240 <../zstd_compression_format.md - ./fitblk_zstd 40960 <../zstd_compression_format.md - ./zwrapbench -qb1e5 ../zstd_compression_format.md - ./zwrapbench -qb1e5B1K ../zstd_compression_format.md - -valgrindTest: VALGRIND = valgrind --leak-check=full --error-exitcode=1 -valgrindTest: STATICLIB = $(IMPLIB) +valgrindTest: VALGRIND = valgrind --track-origins=yes --leak-check=full --error-exitcode=1 +valgrindTest: STATICLIB = -lz $(ZSTDLIBDIR)/libzstd.so valgrindTest: clean example fitblk example_zstd fitblk_zstd zwrapbench @echo "\n ---- valgrind tests ----" $(VALGRIND) ./example + $(VALGRIND) ./example_zstd $(VALGRIND) ./fitblk 10240 <../zstd_compression_format.md $(VALGRIND) ./fitblk 40960 <../zstd_compression_format.md - $(VALGRIND) ./example_zstd $(VALGRIND) ./fitblk_zstd 10240 <../zstd_compression_format.md $(VALGRIND) ./fitblk_zstd 40960 <../zstd_compression_format.md $(VALGRIND) ./zwrapbench -qb1e5 ../zstd_compression_format.md diff --git a/zlibWrapper/examples/zwrapbench.c b/zlibWrapper/examples/zwrapbench.c index f7ed821e..69f372d5 100644 --- a/zlibWrapper/examples/zwrapbench.c +++ b/zlibWrapper/examples/zwrapbench.c @@ -560,7 +560,7 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize, SET_HIGH_PRIORITY; if (g_displayLevel == 1 && !g_additionalParam) - DISPLAY("bench %s %s: input %u bytes, %u iterations, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10)); + DISPLAY("bench %s %s: input %u bytes, %u seconds, %u KB blocks\n", ZSTD_VERSION_STRING, ZSTD_GIT_COMMIT_STRING, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10)); if (cLevelLast < cLevel) cLevelLast = cLevel; diff --git a/zlibWrapper/zstd_zlibwrapper.c b/zlibWrapper/zstd_zlibwrapper.c index 2ad3ee0b..7a825899 100644 --- a/zlibWrapper/zstd_zlibwrapper.c +++ b/zlibWrapper/zstd_zlibwrapper.c @@ -22,8 +22,8 @@ #define ZSTD_HEADERSIZE ZSTD_frameHeaderSize_min #define ZWRAP_DEFAULT_CLEVEL 5 /* Z_DEFAULT_COMPRESSION is translated to ZWRAP_DEFAULT_CLEVEL for zstd */ -#define LOG_WRAPPERC(...) /*printf(__VA_ARGS__)*/ -#define LOG_WRAPPERD(...) /*printf(__VA_ARGS__)*/ +#define LOG_WRAPPERC(...) /* printf(__VA_ARGS__) */ +#define LOG_WRAPPERD(...) /* printf(__VA_ARGS__) */ #define FINISH_WITH_GZ_ERR(msg) { \ @@ -194,6 +194,7 @@ ZEXTERN int ZEXPORT z_deflateInit_ OF((z_streamp strm, int level, strm->state = (struct internal_state*) zwc; /* use state which in not used by user */ strm->total_in = 0; strm->total_out = 0; + strm->adler = 0; return Z_OK; } @@ -468,6 +469,7 @@ ZEXTERN int ZEXPORT z_inflateInit_ OF((z_streamp strm, strm->total_in = 0; strm->total_out = 0; strm->reserved = 1; /* mark as unknown steam */ + strm->adler = 0; } return Z_OK;