diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-11-04 09:04:37 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-11-04 09:04:37 (GMT) |
commit | 7050d4b7672f164144f0cef0a95aa68ad71cf9e6 (patch) | |
tree | 29d5bcceddadf0c5e5c44c1a41b798fa4e353c0a /examples | |
parent | 3de7f00a0b83f0f8ad861789d8da1ad697b1f05a (diff) | |
download | lz4-7050d4b7672f164144f0cef0a95aa68ad71cf9e6.zip lz4-7050d4b7672f164144f0cef0a95aa68ad71cf9e6.tar.gz lz4-7050d4b7672f164144f0cef0a95aa68ad71cf9e6.tar.bz2 |
Updated unsynchronized buffers tests
Diffstat (limited to 'examples')
-rw-r--r-- | examples/HCStreaming_ringBuffer.c | 2 | ||||
-rw-r--r-- | examples/blockStreaming_ringBuffer.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/HCStreaming_ringBuffer.c b/examples/HCStreaming_ringBuffer.c index afe77ae..dfa2670 100644 --- a/examples/HCStreaming_ringBuffer.c +++ b/examples/HCStreaming_ringBuffer.c @@ -30,7 +30,7 @@ enum { MESSAGE_MAX_BYTES = 1024, RING_BUFFER_BYTES = 1024 * 8 + MESSAGE_MAX_BYTES, - DEC_BUFFER_BYTES = RING_BUFFER_BYTES + MESSAGE_MAX_BYTES + DEC_BUFFER_BYTES = RING_BUFFER_BYTES + MESSAGE_MAX_BYTES // Intentionally larger to test unsynchronized ring buffers }; diff --git a/examples/blockStreaming_ringBuffer.c b/examples/blockStreaming_ringBuffer.c index eda721f..beb5e66 100644 --- a/examples/blockStreaming_ringBuffer.c +++ b/examples/blockStreaming_ringBuffer.c @@ -27,7 +27,7 @@ enum { MESSAGE_MAX_BYTES = 1024, RING_BUFFER_BYTES = 1024 * 8 + MESSAGE_MAX_BYTES, - DICT_BYTES = 65536, + DECODE_RING_BUFFER = RING_BUFFER_BYTES + MESSAGE_MAX_BYTES // Intentionally larger, to test unsynchronized ring buffers }; @@ -83,7 +83,7 @@ void test_compress(FILE* outFp, FILE* inpFp) void test_decompress(FILE* outFp, FILE* inpFp) { - static char decBuf[RING_BUFFER_BYTES]; + static char decBuf[DECODE_RING_BUFFER]; int decOffset = 0; LZ4_streamDecode_t lz4StreamDecode_body = { 0 }; LZ4_streamDecode_t* lz4StreamDecode = &lz4StreamDecode_body; @@ -109,7 +109,7 @@ void test_decompress(FILE* outFp, FILE* inpFp) write_bin(outFp, decPtr, decBytes); // Wraparound the ringbuffer offset - if(decOffset >= RING_BUFFER_BYTES - MESSAGE_MAX_BYTES) decOffset = 0; + if(decOffset >= DECODE_RING_BUFFER - MESSAGE_MAX_BYTES) decOffset = 0; } } } |