1 /* @(#) $Id: ./src/os_zlib/zlib-test.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
18 #define ARGV0 "zlib-test"
22 int main(int argc, char **argv)
24 int ret, srcsize, dstsize = 2010;
29 memset(dst2, 0, 2048);
33 printf("%s: string\n", argv[0]);
37 srcsize = strlen(argv[1]);
40 printf("%s: string too large\n", argv[0]);
45 if((ret = os_compress(argv[1], dst, srcsize, dstsize)))
47 printf("Compressed, from %d->%d\n",srcsize, ret);
51 printf("FAILED compressing.\n");
55 /* Setting new srcsize for decompression */
58 if((ret = os_uncompress(dst, dst2, srcsize, dstsize)))
60 printf("Uncompressed ok. String: '%s', size %d->%d\n",
65 printf("FAILED uncompressing.\n");