1 /* @(#) $Id: zlib-test.c,v 1.5 2009/06/24 18:53:06 dcid Exp $ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 3) as published by the FSF - Free Software
17 #define ARGV0 "zlib-test"
21 int main(int argc, char **argv)
23 int ret, srcsize, dstsize = 2010;
28 memset(dst2, 0, 2048);
32 printf("%s: string\n", argv[0]);
36 srcsize = strlen(argv[1]);
39 printf("%s: string too large\n", argv[0]);
44 if((ret = os_compress(argv[1], dst, srcsize, dstsize)))
46 printf("Compressed, from %d->%d\n",srcsize, ret);
50 printf("FAILED compressing.\n");
54 /* Setting new srcsize for decompression */
57 if((ret = os_uncompress(dst, dst2, srcsize, dstsize)))
59 printf("Uncompressed ok. String: '%s', size %d->%d\n",
64 printf("FAILED uncompressing.\n");