X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstodr.c;h=83d2d2c10a1ba189127d0be6d73eeb5f0154434b;hb=fbb0389c468253ae678c1169fe0d7a8d8d54e8cb;hp=b57c656829d1c45059b89831aad12ed3c71cc566;hpb=57f792928a420aca87e4a633eb5e1d6300746b46;p=yaz-moved-to-github.git diff --git a/test/tstodr.c b/test/tstodr.c index b57c656..83d2d2c 100644 --- a/test/tstodr.c +++ b/test/tstodr.c @@ -1,9 +1,6 @@ -/* - * 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.12 2007-08-13 16:23:30 mike Exp $ - * */ #include #include @@ -19,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); @@ -75,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); @@ -108,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