Disable tests and refactor

This commit is contained in:
Stella Lau
2017-08-21 01:59:08 -07:00
parent 023b24e6d4
commit f181f33bdf
13 changed files with 102 additions and 129 deletions
+4 -5
View File
@@ -25,7 +25,7 @@ PRGDIR = ../programs
PYTHON ?= python3
TESTARTEFACT := versionsTest namespaceTest
DEBUGLEVEL= 2
DEBUGLEVEL= 1
DEBUGFLAGS= -g -DZSTD_DEBUG=$(DEBUGLEVEL)
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
@@ -169,10 +169,9 @@ datagen : $(PRGDIR)/datagen.c datagencli.c
roundTripCrash : $(ZSTD_FILES) roundTripCrash.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
OPAQUEFILES := $(ZSTD_FILES) $(ZDICT_FILES) roundTripCrashOpaque.c
roundTripCrashOpaque : LDFLAGS += $(MULTITHREAD_CPP)
roundTripCrashOpaque : LDFLAGS += $(MULTITHREAD_LD)
roundTripCrashOpaque : $(OPAQUEFILES)
cctxParamRoundTrip : LDFLAGS += $(MULTITHREAD_CPP)
cctxParamRoundTrip : LDFLAGS += $(MULTITHREAD_LD)
cctxParamRoundTrip : $(ZSTD_FILES) cctxParamRoundTrip.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
longmatch : $(ZSTD_FILES) longmatch.c
@@ -38,13 +38,16 @@
fprintf(stderr, \
"Error=> %s: %s", \
#f, ZSTD_getErrorName(err)); \
exit(1); \
crash(1); \
} }
/** roundTripTest() :
* Compresses `srcBuff` into `compressedBuff`,
* then decompresses `compressedBuff` into `resultBuff`.
*
* Parameters are currently set manually.
*
* @return : result of decompression, which should be == `srcSize`
* or an error code if either compression or decompression fails.
* Note : `compressedBuffCapacity` should be `>= ZSTD_compressBound(srcSize)`
-5
View File
@@ -136,10 +136,8 @@ size_t local_ZSTD_compressStream(void* dst, size_t dstCapacity, void* buff2, con
buffIn.src = src;
buffIn.size = srcSize;
buffIn.pos = 0;
ZSTD_compressStream(g_cstream, &buffOut, &buffIn);
ZSTD_endStream(g_cstream, &buffOut);
return buffOut.pos;
}
@@ -385,13 +383,11 @@ static size_t benchMem(const void* src, size_t srcSize, U32 benchNb)
const BYTE* ip = dstBuff;
const BYTE* iend;
size_t frameHeaderSize, cBlockSize;
ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, 1); /* it would be better to use direct block compression here */
g_cSize = ZSTD_compress(dstBuff, dstBuffSize, src, srcSize, 1);
frameHeaderSize = ZSTD_getFrameHeader(&zfp, dstBuff, ZSTD_frameHeaderSize_min);
if (frameHeaderSize==0) frameHeaderSize = ZSTD_frameHeaderSize_min;
ip += frameHeaderSize; /* Skip frame Header */
cBlockSize = ZSTD_getcBlockSize(ip, dstBuffSize, &bp); /* Get 1st block type */
if (bp.blockType != bt_compressed) {
DISPLAY("ZSTD_decodeSeqHeaders : impossible to test on this sample (not compressible)\n");
@@ -399,7 +395,6 @@ static size_t benchMem(const void* src, size_t srcSize, U32 benchNb)
}
iend = ip + ZSTD_blockHeaderSize + cBlockSize; /* End of first block */
ip += ZSTD_blockHeaderSize; /* skip block header */
ZSTD_decompressBegin(g_zdc);
ip += ZSTD_decodeLiteralsBlock(g_zdc, ip, iend-ip); /* skip literal segment */
g_cSize = iend-ip;
+2 -2
View File
@@ -1655,9 +1655,9 @@ static int fuzzerTests_newAPI_opaque(U32 seed, U32 nbTests, unsigned startTest,
}
if (FUZ_rand(&lseed) & 1) CHECK_Z (ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_p_forceMaxWindow, FUZ_rand(&lseed) & 1) );
#if 0
if (FUZ_rand(&lseed) & 1) CHECK_Z (ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_p_test, FUZ_rand(&lseed) & 1) );
#endif
/* Apply parameters */