X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_odr.c;h=7f5ef9e6c619f668c00b3d83854ae800e5a9066c;hp=63ad2900c47fe43b712abb3c72537c5d90428d2c;hb=0d6f3ee9720647761ff74414a46828c0b9711ac0;hpb=3107ce3a34993d2f784387f227a50343fff83bbc diff --git a/test/test_odr.c b/test/test_odr.c index 63ad290..7f5ef9e 100644 --- a/test/test_odr.c +++ b/test/test_odr.c @@ -1,7 +1,10 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -22,20 +25,19 @@ void tst_MySequence1(ODR encode, ODR decode) YAZ_CHECK(s); s->first = odr_intdup(encode, 12345); s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second)); - s->second->buf = (unsigned char *) "hello"; + s->second->buf = (char *) "hello"; s->second->len = 5; - s->second->size = 0; s->third = odr_booldup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); - + s->myoid = odr_getoidbystr(decode, MYOID); ret = yc_MySequence(encode, &s, 0, 0); YAZ_CHECK(ret); if (!ret) return; - + ber_buf = odr_getbuf(encode, &ber_len, 0); odr_setbuf(decode, ber_buf, ber_len, 0); @@ -77,9 +79,8 @@ void tst_MySequence2(ODR encode, ODR decode) YAZ_CHECK(s); s->first = 0; /* deliberately miss this .. */ s->second = (Odr_oct *) odr_malloc(encode, sizeof(*s->second)); - s->second->buf = (unsigned char *) "hello"; + s->second->buf = (char *) "hello"; s->second->len = 5; - s->second->size = 0; s->third = odr_booldup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); @@ -127,7 +128,7 @@ static void tst_berint32(ODR encode, ODR decode) Odr_int val; Odr_int ret_val; int r; - + val = 0; odr_reset(encode); r = ber_integer(encode, &val); @@ -250,7 +251,7 @@ static void tst_berint64(ODR encode, ODR decode) Odr_int val; Odr_int ret_val; int r; - + val = (Odr_int) 2 * 2147483648UL; /* 2^32 */ odr_reset(encode); r = ber_integer(encode, &val); @@ -337,7 +338,7 @@ void do_nothing_useful(Odr_int value) Odr_int *valp, *resvalp; char *bufferp; int len; - + /* allocate streams */ if (!(encode = odr_createmem(ODR_ENCODE))) return;