X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fcodec%2Ftstcodec.c;h=6fc6f5c6655f38810cd1967bf3a2648131ec27dc;hb=591d69201fa7de38a5a5411a198767828837db91;hp=c2bc234aefb407e777452154edae344a9a70bf0e;hpb=44ef59f8931ab98331a15e0f15abe2b7b9200260;p=idzebra-moved-to-github.git diff --git a/test/codec/tstcodec.c b/test/codec/tstcodec.c index c2bc234..6fc6f5c 100644 --- a/test/codec/tstcodec.c +++ b/test/codec/tstcodec.c @@ -1,6 +1,6 @@ -/* $Id: tstcodec.c,v 1.5 2005-01-02 20:11:46 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 - Index Data Aps +/* $Id: tstcodec.c,v 1.8 2006-02-20 18:33:09 adam Exp $ + Copyright (C) 1995-2005 + Index Data ApS This file is part of the Zebra server. @@ -20,6 +20,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "../../index/index.h" char *prog = ""; @@ -150,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); }