X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstodr.c;h=33d366bbbae34c387f69db29218e7025980113ea;hb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;hp=f7cc7b911431e5b21760396a8de0bb632f4ace15;hpb=4c176312acdc3444c9afc820f76a393e64668e52;p=yaz-moved-to-github.git diff --git a/test/tstodr.c b/test/tstodr.c index f7cc7b9..33d366b 100644 --- a/test/tstodr.c +++ b/test/tstodr.c @@ -2,13 +2,17 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstodr.c,v 1.3 2005-01-15 19:47:15 adam Exp $ + * $Id: tstodr.c,v 1.6 2005-06-25 15:46:07 adam Exp $ * */ +#include #include #include +#include #include "tstodrcodec.h" +#define MYOID "1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19" + void tst_MySequence1(ODR encode, ODR decode) { char *ber_buf; @@ -24,6 +28,8 @@ void tst_MySequence1(ODR encode, ODR decode) s->third = odr_intdup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); + + s->myoid = odr_getoidbystr(decode, MYOID); if (!yc_MySequence(encode, &s, 0, 0)) exit(1); @@ -46,6 +52,17 @@ void tst_MySequence1(ODR encode, ODR decode) exit(7); if (!t->fifth || *t->fifth != YC_MySequence_enum1) exit(8); + if (!t->myoid) + exit(9); + else + { + int *myoid = odr_getoidbystr(decode, MYOID); + struct oident *oident; + + if (oid_oidcmp(myoid, t->myoid)) + exit(10); + oident = oid_getentbyoid(t->myoid); + } } void tst_MySequence2(ODR encode, ODR decode) @@ -60,6 +77,7 @@ void tst_MySequence2(ODR encode, ODR decode) s->third = odr_intdup(encode, 1); s->fourth = odr_nullval(); s->fifth = odr_intdup(encode, YC_MySequence_enum1); + s->myoid = odr_getoidbystr(encode, MYOID); if (yc_MySequence(encode, &s, 0, 0)) /* should fail */ exit(9); @@ -110,3 +128,11 @@ int main(int argc, char **argv) odr_destroy(odr_decode); exit(0); } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +