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);
22 assert(er.encoded <= (ssize_t)(8 * sizeof(buf)));
24 rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0);
25 assert(rv.code == RC_OK);
27 fprintf(stderr, "%d ENC: %2x%2x\n", testNo,
29 fprintf(stderr, "%d OUT: %d\n", testNo, ti->present);
30 assert(ti->present == to->present);
33 assert(ti->present != T_PR_NOTHING);
36 assert(ti->choice.first.present == to->choice.first.present);
37 assert(ti->choice.first.choice.nothing == to->choice.first.choice.nothing);
40 assert(ti->choice.second == to->choice.second);
43 assert(ti->choice.third == to->choice.third);
47 xer_fprint(stderr, &asn_DEF_T, ti);
48 xer_fprint(stderr, &asn_DEF_T, to);
54 return 0; // this test fails, but not important atm.
56 memset(&t, 0, sizeof(t));
57 t.present = T_PR_first;
58 t.choice.first.present = first_PR_nothing;
59 t.choice.first.choice.nothing = 5;
62 memset(&t, 0, sizeof(t));
63 t.present = T_PR_second;
67 memset(&t, 0, sizeof(t));
68 t.present = T_PR_second;
72 memset(&t, 0, sizeof(t));
73 t.present = T_PR_third;
77 memset(&t, 0, sizeof(t));
78 t.present = T_PR_third;
79 t.choice.third = 4097;