aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2023-04-17 20:47:42 -0700
committerMark Adler <madler@alumni.caltech.edu>2023-04-18 00:08:44 -0700
commitb8a8373ec195c8d286fe7e81e78b4a6d31bd859f (patch)
treeff33b67c4d052a7f0a0318e9c1ac6fd42fd19422 /test
parent3365464851a972fe8ad217b93e80c7cd185a8179 (diff)
downloadzlib-b8a8373ec195c8d286fe7e81e78b4a6d31bd859f.tar.gz
zlib-b8a8373ec195c8d286fe7e81e78b4a6d31bd859f.tar.bz2
zlib-b8a8373ec195c8d286fe7e81e78b4a6d31bd859f.zip
Fix test/example.c to work with FORCE_STORED.
Diffstat (limited to 'test')
-rw-r--r--test/example.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/example.c b/test/example.c
index 1c755bc..582a17a 100644
--- a/test/example.c
+++ b/test/example.c
@@ -267,7 +267,7 @@ void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr,
267 /* Feed in already compressed data and switch to no compression: */ 267 /* Feed in already compressed data and switch to no compression: */
268 deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); 268 deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
269 c_stream.next_in = compr; 269 c_stream.next_in = compr;
270 c_stream.avail_in = (uInt)comprLen/2; 270 c_stream.avail_in = (uInt)uncomprLen/2;
271 err = deflate(&c_stream, Z_NO_FLUSH); 271 err = deflate(&c_stream, Z_NO_FLUSH);
272 CHECK_ERR(err, "deflate"); 272 CHECK_ERR(err, "deflate");
273 273
@@ -318,7 +318,7 @@ void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
318 err = inflateEnd(&d_stream); 318 err = inflateEnd(&d_stream);
319 CHECK_ERR(err, "inflateEnd"); 319 CHECK_ERR(err, "inflateEnd");
320 320
321 if (d_stream.total_out != 2*uncomprLen + comprLen/2) { 321 if (d_stream.total_out != 2*uncomprLen + uncomprLen/2) {
322 fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); 322 fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
323 exit(1); 323 exit(1);
324 } else { 324 } else {
@@ -489,8 +489,8 @@ void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
489 489
490int main(int argc, char *argv[]) { 490int main(int argc, char *argv[]) {
491 Byte *compr, *uncompr; 491 Byte *compr, *uncompr;
492 uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ 492 uLong uncomprLen = 20000;
493 uLong uncomprLen = comprLen; 493 uLong comprLen = 3 * uncomprLen;
494 static const char* myVersion = ZLIB_VERSION; 494 static const char* myVersion = ZLIB_VERSION;
495 495
496 if (zlibVersion()[0] != myVersion[0]) { 496 if (zlibVersion()[0] != myVersion[0]) {
@@ -533,7 +533,7 @@ int main(int argc, char *argv[]) {
533 533
534 test_flush(compr, &comprLen); 534 test_flush(compr, &comprLen);
535 test_sync(compr, comprLen, uncompr, uncomprLen); 535 test_sync(compr, comprLen, uncompr, uncomprLen);
536 comprLen = uncomprLen; 536 comprLen = 3 * uncomprLen;
537 537
538 test_dict_deflate(compr, comprLen); 538 test_dict_deflate(compr, comprLen);
539 test_dict_inflate(compr, comprLen, uncompr, uncomprLen); 539 test_dict_inflate(compr, comprLen, uncompr, uncomprLen);