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
16 #define ARGV0 "zlib-test"
20 int main(int argc, char **argv)
22 unsigned long int ret, srcsize, dstsize = 2010;
27 memset(dst2, 0, 2048);
31 printf("%s: string\n", argv[0]);
35 srcsize = strlen(argv[1]);
38 printf("%s: string too large\n", argv[0]);
43 if((ret = os_zlib_compress(argv[1], dst, srcsize, dstsize)))
45 printf("Compressed, from %lu->%lu\n",srcsize, ret);
49 printf("FAILED compressing.\n");
53 /* Setting new srcsize for decompression */
56 if((ret = os_zlib_uncompress(dst, dst2, srcsize, dstsize)))
58 printf("Uncompressed ok. String: '%s', size %lu->%lu\n",
63 printf("FAILED uncompressing.\n");