summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-09 17:04:09 (GMT)
committerYann Collet <cyan@fb.com>2016-11-09 17:04:09 (GMT)
commit0c5e2e4d1bf7a4abed98913fd526779976214ea7 (patch)
tree678ce87b856c2e027e196b6d4228cd8095cc33a8 /tests
parentfafba397343dbce6d30ba459d9d9f9f98cfbdd2d (diff)
parent2987eb41792d3ae7a38096651a7d689a0bb783ab (diff)
downloadlz4-0c5e2e4d1bf7a4abed98913fd526779976214ea7.zip
lz4-0c5e2e4d1bf7a4abed98913fd526779976214ea7.tar.gz
lz4-0c5e2e4d1bf7a4abed98913fd526779976214ea7.tar.bz2
Merge branch 'dev' of github.com:Cyan4973/lz4 into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile10
-rw-r--r--tests/fullbench.c16
2 files changed, 21 insertions, 5 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 9415f7b..6df6381 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -44,7 +44,7 @@ PYTHON?= python3
CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes
CFLAGS += $(MOREFLAGS)
-CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ -DLZ4_DLL_EXPORT=1
+CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_
FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
@@ -85,6 +85,14 @@ fullbench : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xx
fullbench32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c
$(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+fullbench-lib: fullbench.c $(LZ4DIR)/xxhash.c
+ $(MAKE) -C $(LZ4DIR) liblz4.a
+ $(CC) $(FLAGS) $^ -o $@$(EXT) $(LZ4DIR)/liblz4.a
+
+fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
+ $(MAKE) -C $(LZ4DIR) liblz4
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/liblz4.dll.a
+
fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
diff --git a/tests/fullbench.c b/tests/fullbench.c
index 67442b2..975cf8a 100644
--- a/tests/fullbench.c
+++ b/tests/fullbench.c
@@ -294,6 +294,7 @@ static int local_LZ4_compress_limitedOutput_continue(const char* in, char* out,
return LZ4_compress_limitedOutput_continue(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize)-1);
}
+#ifndef LZ4_DLL_IMPORT
/* declare hidden function */
int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize);
@@ -301,6 +302,7 @@ static int local_LZ4_compress_forceDict(const char* in, char* out, int inSize)
{
return LZ4_compress_forceExtDict(&LZ4_stream, in, out, inSize);
}
+#endif
/* HC compression functions */
@@ -364,6 +366,7 @@ static int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int in
return outSize;
}
+#ifndef LZ4_DLL_IMPORT
extern int LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize, const char* dict, int dictSize);
static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize)
@@ -372,6 +375,7 @@ static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int
LZ4_decompress_safe_forceExtDict(in, out, inSize, outSize, out - 65536, 65536);
return outSize;
}
+#endif
static int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSize, int outSize)
{
@@ -521,8 +525,10 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
case 13: compressionFunction = local_LZ4_compressHC_limitedOutput_withStateHC; compressorName = "LZ4_compressHC_limitedOutput_withStateHC"; break;
case 14: compressionFunction = local_LZ4_compressHC_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_continue"; break;
case 15: compressionFunction = local_LZ4_compressHC_limitedOutput_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_limitedOutput_continue"; break;
- case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break;
- case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame";
+#ifndef LZ4_DLL_IMPORT
+ case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break;
+#endif
+ case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame";
chunkP[0].origSize = (int)benchedSize; nbChunks=1;
break;
case 40: compressionFunction = local_LZ4_saveDict; compressorName = "LZ4_saveDict";
@@ -614,8 +620,10 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles)
case 4: decompressionFunction = LZ4_decompress_safe; dName = "LZ4_decompress_safe"; break;
case 6: decompressionFunction = local_LZ4_decompress_safe_usingDict; dName = "LZ4_decompress_safe_usingDict"; break;
case 7: decompressionFunction = local_LZ4_decompress_safe_partial; dName = "LZ4_decompress_safe_partial"; break;
- case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break;
- case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress";
+#ifndef LZ4_DLL_IMPORT
+ case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break;
+#endif
+ case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress";
errorCode = LZ4F_compressFrame(compressed_buff, compressedBuffSize, orig_buff, benchedSize, NULL);
if (LZ4F_isError(errorCode)) {
DISPLAY("Error while preparing compressed frame\n");