summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-01 21:44:02 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-01 21:44:02 (GMT)
commitf7f67e778c9261fa5843811068f3eb3cc4e70509 (patch)
tree0e92ba498e8309a6cdbbde28cd64efae7da1fb10 /programs
parent2f33c77d53793cc025ed9484870c9a2b0c879261 (diff)
downloadlz4-f7f67e778c9261fa5843811068f3eb3cc4e70509.zip
lz4-f7f67e778c9261fa5843811068f3eb3cc4e70509.tar.gz
lz4-f7f67e778c9261fa5843811068f3eb3cc4e70509.tar.bz2
Added : preliminary frame decompression function
Diffstat (limited to 'programs')
-rw-r--r--programs/Makefile5
-rw-r--r--programs/frametest.c36
2 files changed, 17 insertions, 24 deletions
diff --git a/programs/Makefile b/programs/Makefile
index 21c7514..82a5e66 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -132,7 +132,7 @@ uninstall:
[ -f $(DESTDIR)$(MANDIR)/lz4cat.1 ] && rm -f $(DESTDIR)$(MANDIR)/lz4cat.1
@echo lz4 successfully uninstalled
-test-native: test-lz4 test-lz4c test-fullbench test-fuzzer test-mem
+test-native: test-lz4 test-lz4c test-frame test-fullbench test-fuzzer test-mem
test-force32: test-lz4c32 test-fullbench32 test-fuzzer32 test-mem32
@@ -169,6 +169,9 @@ test-fuzzer: fuzzer
test-fuzzer32: fuzzer32
./fuzzer32 --no-prompt
+test-frame: frametest
+ ./frametest
+
test-mem: lz4 datagen
./datagen -g16KB > tmp
valgrind ./lz4 -9 -BD -f tmp /dev/null
diff --git a/programs/frametest.c b/programs/frametest.c
index ad93182..e61205a 100644
--- a/programs/frametest.c
+++ b/programs/frametest.c
@@ -73,18 +73,19 @@
# define LZ4_VERSION ""
#endif
-#define NB_ATTEMPTS (1<<16)
-#define COMPRESSIBLE_NOISE_LENGTH (1 << 21)
-#define FUZ_MAX_BLOCK_SIZE (1 << 17)
-#define FUZ_MAX_DICT_SIZE (1 << 15)
+#define KB *(1U<<10)
+#define MB *(1U<<20)
+#define GB *(1U<<30)
+
+#define NB_ATTEMPTS (64 KB)
+#define COMPRESSIBLE_NOISE_LENGTH (2 MB)
+#define FUZ_MAX_BLOCK_SIZE (128 KB)
+#define FUZ_MAX_DICT_SIZE (32 KB)
#define FUZ_COMPRESSIBILITY_DEFAULT 50
#define PRIME1 2654435761U
#define PRIME2 2246822519U
#define PRIME3 3266489917U
-#define KB *(1U<<10)
-#define MB *(1U<<20)
-#define GB *(1U<<30)
/**************************************
@@ -114,7 +115,7 @@ static int FUZ_GetMilliStart(void)
return nCount;
}
-
+/*
static int FUZ_GetMilliSpan( int nTimeStart )
{
int nSpan = FUZ_GetMilliStart() - nTimeStart;
@@ -122,6 +123,7 @@ static int FUZ_GetMilliSpan( int nTimeStart )
nSpan += 0x100000 * 1000;
return nSpan;
}
+*/
# define FUZ_rotl32(x,r) ((x << r) | (x >> (32 - r)))
@@ -176,8 +178,6 @@ static void FUZ_fillCompressibleNoiseBuffer(void* buffer, unsigned bufferSize, d
-#define FUZ_MAX(a,b) (a>b?a:b)
-
int frameTest(U32 seed, int nbCycles, int startCycle, double compressibility)
{
int testResult = 0;
@@ -283,8 +283,8 @@ int FUZ_usage(void)
}
-int main(int argc, char** argv) {
- U32 timestamp = FUZ_GetMilliStart();
+int main(int argc, char** argv)
+{
U32 seed=0;
int seedset=0;
int argNb;
@@ -367,17 +367,7 @@ int main(int argc, char** argv) {
// Get Seed
printf("Starting lz4frame tester (%i-bits, %s)\n", (int)(sizeof(size_t)*8), LZ4_VERSION);
- if (!seedset)
- {
- char userInput[50] = {0};
- printf("Select an Initialisation number (default : random) : ");
- fflush(stdout);
- if ( no_prompt || fgets(userInput, sizeof userInput, stdin) )
- {
- if ( sscanf(userInput, "%u", &seed) == 1 ) {}
- else seed = FUZ_GetMilliSpan(timestamp);
- }
- }
+ if (!seedset) seed = FUZ_GetMilliStart() % 10000;
printf("Seed = %u\n", seed);
if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) printf("Compressibility : %i%%\n", proba);