1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
17 #define ARGV0 "zlib-test"
22 int main(int argc, char **argv)
24 unsigned long int ret, srcsize, dstsize = 2010;
29 memset(dst2, 0, 2048);
32 printf("%s: string\n", argv[0]);
36 srcsize = strlen(argv[1]);
38 printf("%s: string too large\n", argv[0]);
43 if ((ret = os_zlib_compress(argv[1], dst, srcsize, dstsize))) {
44 printf("Compressed, from %lu->%lu\n", srcsize, ret);
46 printf("FAILED compressing.\n");
50 /* Set new srcsize for decompression */
53 if ((ret = os_zlib_uncompress(dst, dst2, srcsize, dstsize))) {
54 printf("Uncompressed ok. String: '%s', size %lu->%lu\n",
57 printf("FAILED uncompressing.\n");