13 verify(int testNo, T_t *ti) {
19 er = uper_encode_to_buffer(&asn_DEF_T, 0, ti, buf, sizeof buf);
20 fprintf(stderr, "%d IN: %d => %zd\n", testNo, ti->present, er.encoded);
21 assert(er.encoded >= 1 && er.encoded <= (ssize_t)(8 * sizeof(buf)));
23 rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0);
24 assert(rv.code == RC_OK);
26 fprintf(stderr, "%d ENC: %2x%2x\n", testNo,
28 fprintf(stderr, "%d OUT: %d\n", testNo, ti->present);
29 assert(ti->present == to->present);
30 if(ti->present == T_PR_second) {
31 assert(ti->choice.second == to->choice.second);
33 assert(ti->choice.first.present == to->choice.first.present);
34 assert(ti->choice.first.choice.nothing == to->choice.first.choice.nothing);
37 xer_fprint(stderr, &asn_DEF_T, ti);
38 xer_fprint(stderr, &asn_DEF_T, to);
40 ASN_STRUCT_FREE(asn_DEF_T, to);
46 memset(&t, 0, sizeof(t));
47 t.present = T_PR_first;
48 t.choice.first.present = first_PR_nothing;
49 t.choice.first.choice.nothing = 5;
52 memset(&t, 0, sizeof(t));
53 t.present = T_PR_first;
54 t.choice.first.present = first_PR_nothing;
55 t.choice.first.choice.nothing = 6;
58 memset(&t, 0, sizeof(t));
59 t.present = T_PR_second;