- if (!yc_MySequence(decode, &t, 0, 0))
- exit(2);
- if (!t->first || *t->first != 12345)
- exit(3);
- if (!t->second || !t->second->buf || t->second->len != 5)
- exit(4);
- if (memcmp(t->second->buf, "hello", t->second->len))
- exit(5);
- if (!t->third || *t->third != 1)
- exit(6);
- if (!t->fourth)
- exit(7);
- if (!t->fifth || *t->fifth != YC_MySequence_enum1)
- exit(8);
+ ret = yc_MySequence(decode, &t, 0, 0);
+ YAZ_CHECK(ret);
+ if (!ret)
+ return;
+
+ YAZ_CHECK(t);
+
+ YAZ_CHECK(t->first && *t->first == 12345);
+
+ YAZ_CHECK(t->second && t->second->buf && t->second->len == 5);
+
+ YAZ_CHECK(t->second && t->second->buf && t->second->len == 5 &&
+ memcmp(t->second->buf, "hello", t->second->len) == 0);
+
+ YAZ_CHECK(t->third && *t->third == 1);
+
+ YAZ_CHECK(t->fourth);
+
+ YAZ_CHECK(t->fifth && *t->fifth == YC_MySequence_enum1);
+
+ YAZ_CHECK(t->myoid);
+ if (t->myoid)
+ {
+ int *myoid = odr_getoidbystr(decode, MYOID);
+
+ YAZ_CHECK(oid_oidcmp(myoid, t->myoid) == 0);
+ }