From bdde4e09d21edff02ea5093b7f6eccbf166b272f Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:08:07 -0700 Subject: zlib 0.92 --- inftest.c | 69 --------------------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 inftest.c (limited to 'inftest.c') diff --git a/inftest.c b/inftest.c deleted file mode 100644 index d711bfa..0000000 --- a/inftest.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include "zutil.h" - -void main __P((void)); - -/* This test is in honor of Ed Hamrick who suggested that the interface - to inflate be a byte at a time--this implements that, and is, of course, - monumentally slow. It has the virtue though of stressing the push-pull - interface for testing purposes. */ - -void main() -{ - int a, r; - char c; - z_stream z; - - z.zalloc = Z_NULL; - z.zfree = Z_NULL; - r = inflateInit(&z); - if (r != Z_OK) - fprintf(stderr, "init error: %s\n", z_errmsg[1 - r]); - while ((a = getchar()) != EOF) - { - /* feed one byte of input */ - z.avail_out = 0; - c = (char)a; - z.next_in = (Byte*)&c; - z.avail_in = 1; - r = inflate(&z, 0); - if (r == Z_STREAM_END) - break; - if (r != Z_OK) - { - fprintf(stderr, "inflate error: %s\n", z_errmsg[1 - r]); - break; - } - if (z.avail_in != 0) - { - fprintf(stderr, "inflate didn't eat byte and didn't say buf err!\n"); - break; - } - - /* empty output one byte at a time */ - while (1) - { - z.next_out = (Byte*)&c; - z.avail_out = 1; - r = inflate(&z, 0); - if (r == Z_STREAM_END) - break; - if (r != Z_OK && r != Z_BUF_ERROR) - { - fprintf(stderr, "inflate error: %s\n", z_errmsg[1 - r]); - break; - } - if (z.avail_out == 0) - putchar(c); - else - break; - } - if (r != Z_OK && r != Z_BUF_ERROR) - break; - } - inflateEnd(&z); - fprintf(stderr, "%ld bytes in, %ld bytes out\n", z.total_in, z.total_out); - if (z.msg != NULL) - fprintf(stderr, "msg is <%s>\n", z.msg); -} -- cgit v1.2.3-55-g6feb