X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftstodr.c;h=06c28eab419c5c83a7e7cbaef980bd4689dfdf59;hp=1ebacf39982b92499eb9648b2476010eb3ec23fb;hb=653561fa749dbd5c0a438f249f2927ea33d5843c;hpb=8d691989077a0addcbd840d769dce6700f3d9622 diff --git a/test/tstodr.c b/test/tstodr.c index 1ebacf3..06c28ea 100644 --- a/test/tstodr.c +++ b/test/tstodr.c @@ -1,14 +1,10 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. - * - * $Id: tstodr.c,v 1.9 2007-01-03 08:42:16 adam Exp $ - * */ #include #include -#include -#include +#include #include "tstodrcodec.h" #include @@ -20,16 +16,16 @@ void tst_MySequence1(ODR encode, ODR decode) int ret; char *ber_buf; int ber_len; - Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); + Yc_MySequence *s = (Yc_MySequence *) odr_malloc(encode, sizeof(*s)); Yc_MySequence *t; YAZ_CHECK(s); s->first = odr_intdup(encode, 12345); - s->second = odr_malloc(encode, sizeof(*s->second)); + s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second)); s->second->buf = (unsigned char *) "hello"; s->second->len = 5; s->second->size = 0; - s->third = odr_intdup(encode, 1); + s->third = odr_booldup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); @@ -67,7 +63,7 @@ void tst_MySequence1(ODR encode, ODR decode) YAZ_CHECK(t->myoid); if (t->myoid) { - int *myoid = odr_getoidbystr(decode, MYOID); + Odr_oid *myoid = odr_getoidbystr(decode, MYOID); YAZ_CHECK(oid_oidcmp(myoid, t->myoid) == 0); } @@ -76,15 +72,15 @@ void tst_MySequence1(ODR encode, ODR decode) void tst_MySequence2(ODR encode, ODR decode) { int ret; - Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); + Yc_MySequence *s = (Yc_MySequence *) odr_malloc(encode, sizeof(*s)); YAZ_CHECK(s); s->first = 0; /* deliberately miss this .. */ - s->second = odr_malloc(encode, sizeof(*s->second)); + s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second)); s->second->buf = (unsigned char *) "hello"; s->second->len = 5; s->second->size = 0; - s->third = odr_intdup(encode, 1); + s->third = odr_booldup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); s->myoid = odr_getoidbystr(encode, MYOID); @@ -109,13 +105,13 @@ void tst_MySequence3(ODR encode, ODR decode) Yc_MySequence *t; srand(123); - for (i = 0; i<1000; i++) + for (i = 0; i < 1000; i++) { int j; - for (j = 0; j