summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-08-30 11:32:09 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-08-30 11:32:09 (GMT)
commit14a28c063319a8d7f5da59db6b6a6ef25336b726 (patch)
tree22e2c2f27da6baeaf2f9d71445f3c8175128706e /programs
parentbb902d803e4e493ee933e8a1acb9ff8a8fcffddb (diff)
downloadlz4-14a28c063319a8d7f5da59db6b6a6ef25336b726.zip
lz4-14a28c063319a8d7f5da59db6b6a6ef25336b726.tar.gz
lz4-14a28c063319a8d7f5da59db6b6a6ef25336b726.tar.bz2
minor fuzzer cleaning
Diffstat (limited to 'programs')
-rw-r--r--programs/fuzzer.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index b302078..6dff4cb 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -85,9 +85,9 @@
-//**************************************
-// Macros
-//**************************************
+/*****************************************
+ Macros
+*****************************************/
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); }
@@ -135,7 +135,7 @@ unsigned int FUZ_rand(unsigned int* src)
#define FUZ_RAND15BITS ((FUZ_rand(seed) >> 3) & 32767)
-#define FUZ_RANDLENGTH ( ((FUZ_rand(seed) >> 7) & 3) ? (FUZ_rand(seed) % 14) : (FUZ_rand(seed) & 511) + 15)
+#define FUZ_RANDLENGTH ( ((FUZ_rand(seed) >> 7) & 3) ? (FUZ_rand(seed) % 15) : (FUZ_rand(seed) % 510) + 15)
void FUZ_fillCompressibleNoiseBuffer(void* buffer, int bufferSize, double proba, U32* seed)
{
BYTE* BBuffer = (BYTE*)buffer;
@@ -173,33 +173,9 @@ void FUZ_fillCompressibleNoiseBuffer(void* buffer, int bufferSize, double proba,
}
-// No longer useful; included into issue 134
-int FUZ_Issue52(void)
-{
- char* output;
- char* input;
- int i, r;
-
- // Overflow test, by Ludwig Strigeus
- printf("Overflow test (issue 52)...");
- input = (char*) malloc (20<<20);
- output = (char*) malloc (20<<20);
- input[0] = 0x0F;
- input[1] = 0x00;
- input[2] = 0x00;
- for(i = 3; i < 16840000; i++) input[i] = 0xff;
- r = LZ4_decompress_safe(input, output, 20<<20, 20<<20);
-
- free(input);
- free(output);
- printf(" Passed (return = %i < 0)\n",r);
- return 0;
-}
-
-
#define MAX_NB_BUFF_I134 150
#define BLOCKSIZE_I134 (32 MB)
-int FUZ_Issue134(void)
+int FUZ_AddressOverflow(void)
{
char* buffers[MAX_NB_BUFF_I134+1] = {0};
int i, nbBuff=0;
@@ -762,8 +738,7 @@ int main(int argc, char** argv) {
printf("Seed = %u\n", seed);
if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) printf("Compressibility : %i%%\n", proba);
- //FUZ_Issue52();
- FUZ_Issue134();
+ FUZ_AddressOverflow();
if (nbTests<=0) nbTests=1;