X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fcodec%2Ftstcodec.c;h=0c993e0b03f9542aa3c5f7a33780c5c24f61385d;hb=7415d28c149c1bab51fe93aeaccdd14085b69bd9;hp=af47b7d786220640c50ac7e84c91096cc66b0be6;hpb=39cb125e7755c6058a93dada8d5172804213cf8e;p=idzebra-moved-to-github.git diff --git a/test/codec/tstcodec.c b/test/codec/tstcodec.c index af47b7d..0c993e0 100644 --- a/test/codec/tstcodec.c +++ b/test/codec/tstcodec.c @@ -1,6 +1,6 @@ -/* $Id: tstcodec.c,v 1.4 2004-11-29 21:55:28 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 - Index Data Aps +/* $Id: tstcodec.c,v 1.9 2006-05-10 08:13:36 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 = ""; @@ -113,9 +114,13 @@ void tstcodec1() char buf[100]; char *dst = buf; const char *src; - struct it_key key1, key2; + struct it_key key1; + struct it_key key2; void *codec_handle =iscz1_start(); + memset(&key1, 0, sizeof(key1)); + memset(&key2, 0, sizeof(key2)); + key1.len = 4; key1.mem[0] = 4*65536+1016; key1.mem[1] = 24339; @@ -139,21 +144,91 @@ void tstcodec1() if (memcmp(&key1, &key2, sizeof(key1))) { - printf ("keys differ in tstcodec1\n"); - exit(1); + const char *cp1 = (char*) &key1; + const char *cp2 = (char*) &key2; + int i; + 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); } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +