summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-08-24 23:59:47 (GMT)
committerYann Collet <cyan@fb.com>2017-08-24 23:59:47 (GMT)
commit82ccdec2fb04316ae51ddf2666eecc397f2b1fd9 (patch)
treea6b69b5efad389d85e83269ccdf397ac4204d383 /tests
parent3ec89940d5ea32bcfaa07ef1f20a7ebccaea2c21 (diff)
downloadlz4-82ccdec2fb04316ae51ddf2666eecc397f2b1fd9.zip
lz4-82ccdec2fb04316ae51ddf2666eecc397f2b1fd9.tar.gz
lz4-82ccdec2fb04316ae51ddf2666eecc397f2b1fd9.tar.bz2
minor : added header license
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile3
-rw-r--r--tests/fasttest.c36
2 files changed, 31 insertions, 8 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 5b30684..d2d05af 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,6 +1,6 @@
# ##########################################################################
# LZ4 programs - Makefile
-# Copyright (C) Yann Collet 2011-2016
+# Copyright (C) Yann Collet 2011-2017
#
# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets
#
@@ -76,7 +76,6 @@ lz4c:
lz4c32: # create a 32-bits version for 32/64 interop tests
$(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)"
- cp $(LZ4) $(LZ4)c32
fullbench : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o fullbench.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
diff --git a/tests/fasttest.c b/tests/fasttest.c
index a165293..07811f6 100644
--- a/tests/fasttest.c
+++ b/tests/fasttest.c
@@ -1,8 +1,33 @@
+/*
+ fasttest.c -
+ Copyright (C) Yann Collet 2012-2017
+
+ GPL v2 License
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ You can contact the author at :
+ - LZ4 homepage : http://www.lz4.org
+ - LZ4 source repo : https://github.com/lz4/lz4
+*/
+
/**************************************
* Compiler Options
**************************************/
#ifdef _MSC_VER /* Visual Studio */
-# define _CRT_SECURE_NO_WARNINGS // for MSVC
+# define _CRT_SECURE_NO_WARNINGS /* for MSVC */
# define snprintf sprintf_s
#endif
#ifdef __GNUC__
@@ -35,16 +60,15 @@ int test_compress(const char *input, int inSize, char *output, int outSize)
const int length = inSize >> 2;
if (inSize > 1024) return -2;
if (outSize - (outOffset + 8) < LZ4_compressBound(length)) return -3;
- {
- const int outBytes = LZ4_compress_fast_continue(
- lz4Stream, input + inOffset, output + outOffset + 8, length, outSize-outOffset, 1);
+ { const int outBytes = LZ4_compress_fast_continue(
+ lz4Stream, input + inOffset, output + outOffset + 8,
+ length, outSize-outOffset, 1);
if(outBytes <= 0) return -4;
memcpy(output + outOffset, &length, 4); /* input length */
memcpy(output + outOffset + 4, &outBytes, 4); /* output length */
inOffset += length;
outOffset += outBytes + 8;
- }
- }
+ } }
if (outOffset + 8 > outSize) return -5;
memset(output + outOffset, 0, 4);
memset(output + outOffset + 4, 0, 4);