From 591d69201fa7de38a5a5411a198767828837db91 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 20 Feb 2006 18:33:09 +0000 Subject: [PATCH] More testing of iscz1_{de,en}code --- test/codec/tstcodec.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/test/codec/tstcodec.c b/test/codec/tstcodec.c index 3e46866..6fc6f5c 100644 --- a/test/codec/tstcodec.c +++ b/test/codec/tstcodec.c @@ -1,4 +1,4 @@ -/* $Id: tstcodec.c,v 1.7 2005-08-05 10:33:05 adam Exp $ +/* $Id: tstcodec.c,v 1.8 2006-02-20 18:33:09 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -151,17 +151,76 @@ void tstcodec1() printf ("offset=%d char1=%d char2=%d\n", i, cp1[i], cp2[i]); } } - + +int tstcodec2(int num) +{ + int errors = 0; + int i; + int max = 2048; + int neg = 0; /* iscz1_{en,de}code does not handle negative numbers */ + void *encode_handle =iscz1_start(); + void *decode_handle =iscz1_start(); + + srand(12); + for (i = 0; i 1) num = atoi(argv[1]); if (num < 1 || num > 100000000) num = 10000; tstcodec1(); - exit(tst_encode(num)); + ret = tstcodec2(500); + ret = tst_encode(num); + exit(ret); } -- 1.7.10.4