Update unit test

This commit is contained in:
Denis Kenzior 2009-07-02 12:46:35 -05:00
parent e391d8d581
commit 5ec2e69daf
1 changed files with 22 additions and 0 deletions

View File

@ -852,6 +852,9 @@ static void test_cbs_encode_decode()
unsigned char pdu[88];
int len;
char *encoded_pdu;
GSList *l;
char iso639_lang[3];
char *utf8;
decoded_pdu = decode_hex(cbs1, -1, &pdu_len, 0);
@ -873,6 +876,25 @@ static void test_cbs_encode_decode()
g_assert(cbs.max_pages == 1);
g_assert(cbs.page == 1);
l = g_slist_append(NULL, &cbs);
utf8 = cbs_decode_text(l, iso639_lang);
g_assert(utf8);
if (g_test_verbose()) {
g_printf("%s\n", utf8);
if (iso639_lang[0] == '\0')
g_printf("Lang: Unspecified\n");
else
g_printf("Lang: %s\n", iso639_lang);
}
g_assert(strcmp(utf8, "Belconnen") == 0);
g_assert(strcmp(iso639_lang, "en") == 0);
g_slist_free(l);
ret = cbs_encode(&cbs, &len, pdu);
g_assert(ret);