summaryrefslogtreecommitdiff
path: root/test/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/example.c')
-rw-r--r--test/example.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/test/example.c b/test/example.c
index 50fc370..15bf810 100644
--- a/test/example.c
+++ b/test/example.c
@@ -39,35 +39,11 @@ void test_dict_inflate (Byte *compr, uLong comprLen, Byte *uncompr, uLong uncom
int main (int argc, char *argv[]);
-#ifdef Z_SOLO
-
-void *myalloc (void *, unsigned, unsigned);
-void myfree (void *, void *);
-
-void *myalloc(void *q, unsigned n, unsigned m)
-{
- q = Z_NULL;
- return calloc(n, m);
-}
-
-void myfree(void *q, void *p)
-{
- q = Z_NULL;
- free(p);
-}
-
-static alloc_func zalloc = myalloc;
-static free_func zfree = myfree;
-
-#else /* !Z_SOLO */
-
static alloc_func zalloc = (alloc_func)0;
static free_func zfree = (free_func)0;
void test_compress (Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen);
-void test_gzio (const char *fname,
- Byte *uncompr, uLong uncomprLen);
/* ===========================================================================
* Test compress() and uncompress()
@@ -93,6 +69,10 @@ void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)
}
}
+#ifdef WITH_GZFILEOP
+void test_gzio (const char *fname,
+ Byte *uncompr, uLong uncomprLen);
+
/* ===========================================================================
* Test read/write of .gz files
*/
@@ -174,7 +154,7 @@ void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen)
#endif
}
-#endif /* Z_SOLO */
+#endif /* WITH_GZFILEOP */
/* ===========================================================================
* Test deflate() with small buffers
@@ -536,11 +516,9 @@ int main(int argc, char *argv[])
exit(1);
}
-#ifdef Z_SOLO
- argc = strlen(argv[0]);
-#else
test_compress(compr, comprLen, uncompr, uncomprLen);
+#ifdef WITH_GZFILEOP
test_gzio((argc > 1 ? argv[1] : TESTFILE),
uncompr, uncomprLen);
#endif