From: George Lu Date: Tue, 5 Jun 2018 20:24:00 +0000 (-0700) Subject: Partial compilation test? X-Git-Tag: v1.3.5~3^2~29^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2496ab60663992eb566dd221705da86fc9dafc7;p=thirdparty%2Fzstd.git Partial compilation test? --- diff --git a/lib/log b/lib/log new file mode 100644 index 000000000..7f4d68a89 --- /dev/null +++ b/lib/log @@ -0,0 +1,28 @@ +entropy_common.o: +error_private.o: +fse_decompress.o: +pool.o: +threading.o: +xxhash.o: +zstd_common.o: +fse_compress.o: +huf_compress.o: +zstd_compress.o: +zstd_double_fast.o: +zstd_fast.o: +zstd_lazy.o: +zstd_ldm.o: +zstd_opt.o: +zstdmt_compress.o: +huf_decompress.o: +zstd_decompress.o: +zbuff_common.o: +zbuff_compress.o: +zbuff_decompress.o: +cover.o: +divsufsort.o: +zdict.o: +zstd_v04.o: +zstd_v05.o: +zstd_v06.o: +zstd_v07.o: diff --git a/tests/Makefile b/tests/Makefile index c4cbe1bdf..65474db4d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -233,6 +233,14 @@ else $(CC) $(FLAGS) $< -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so # broken on Mac endif +partial : partial.c zstd-dll +ifneq (,$(filter Windows%,$(OS))) + cp $(ZSTDDIR)/dll/libzstd.dll . + $(CC) $(FLAGS) $< -o $@$(EXT) -DZSTD_DLL_IMPORT=1 libzstd.dll +else + $(CC) $(FLAGS) $< -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so # broken on Mac +endif + poolTests : poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT) @@ -255,7 +263,7 @@ clean: zstreamtest$(EXT) zstreamtest32$(EXT) \ datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \ symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \ - decodecorpus$(EXT) checkTag$(EXT) + decodecorpus$(EXT) checkTag$(EXT) partial$(EXT) @echo Cleaning completed @@ -387,6 +395,9 @@ test-invalidDictionaries: invalidDictionaries test-symbols: symbols $(QEMU_SYS) ./symbols +test-partial: partial + $(QEMU_SYS) ./partial + test-legacy: legacy $(QEMU_SYS) ./legacy diff --git a/tests/partial b/tests/partial new file mode 100755 index 000000000..7abd3498a Binary files /dev/null and b/tests/partial differ diff --git a/tests/partial.c b/tests/partial.c new file mode 100644 index 000000000..8756e6c78 --- /dev/null +++ b/tests/partial.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +#include +#include "zstd_errors.h" +//#define ZSTD_STATIC_LINKING_ONLY +#include "zstd.h" +#define ZBUFF_DISABLE_DEPRECATE_WARNINGS +#define ZBUFF_STATIC_LINKING_ONLY +#include "zbuff.h" +#define ZDICT_DISABLE_DEPRECATE_WARNINGS +#define ZDICT_STATIC_LINKING_ONLY +#include "zdict.h" + +/* +size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel) __attribute__((weak)); //compress +size_t ZSTD_decompress( void* dst, size_t dstCapacity, const void* src, size_t compressedSize) __attribute__((weak)); //decompress +int weakfunc() __attribute__((weak)); //deprecated +int weakfunc() __attribute__((weak)); //dictbuilder +int weakfunc() __attribute__((weak)); //legacy +*/ +//size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel) __attribute__((weak)); //compress +//size_t ZSTD_decompress( void* dst, size_t dstCapacity, const void* src, size_t compressedSize) __attribute__((weak)); //decompress +unsigned ZBUFF_isError(size_t errorCode) __attribute__((weak)); //deprecated +unsigned ZDICT_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv07_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv06_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv05_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv04_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv03_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv02_isError(size_t errorCode) __attribute__((weak)); +unsigned ZBUFFv01_isError(size_t errorCode) __attribute__((weak)); + +int checkCompress(void) { + if(ZSTD_compress) { + return 1; + } else { + return 0; + } +} + +int checkDecompress(void) { + if(ZSTD_decompress) { + return 1; + } else { + return 0; + } +} + +int checkDeprecated(void) { + if(ZBUFF_isError) { + return 1; + } else { + return 0; + } +} + +int checkDictBuilder(void) { + if(ZDICT_isError) { + return 1; + } else { + return 0; + } +} + +int checkLegacy(void) { + if(ZBUFFv01_isError) { + return 1; + } else if (ZBUFFv02_isError) { + return 2; + } else if (ZBUFFv03_isError) { + return 3; + } else if (ZBUFFv04_isError) { + return 4; + } else if (ZBUFFv05_isError) { + return 5; + } else if (ZBUFFv06_isError) { + return 6; + } else if (ZBUFFv07_isError) { + return 7; + } + return 0; +} + +int main(void){//int argc, const char** argv) { + //const void **symbol; + //(void)argc; + //(void)argv; + + printf("%d %d %d %d %d\n", checkCompress(), checkDecompress(), checkDeprecated(), checkDictBuilder(), checkLegacy()); + return 0; +}