From: Yang Gu <gyagp0@gmail.com>
To: ofono@ofono.org
Subject: [PATCH 7/8] teststk: Add test for launch browser parser
Date: Wed, 26 May 2010 22:39:13 +0800 [thread overview]
Message-ID: <1274884754-12977-7-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1274884754-12977-1-git-send-email-yang.gu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 27949 bytes --]
---
unit/test-stkutil.c | 790 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 790 insertions(+), 0 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 77e05c4..2637ec0 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -397,6 +397,49 @@ static inline void check_language(const char *command, const char *test)
check_common_text(command, test);
}
+/* Defined in TS 102.223 Section 8.47 */
+static inline void check_browser_id(const unsigned char command,
+ const unsigned char test)
+{
+ check_common_byte(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.48 */
+static inline void check_url(const char *command, const char *test)
+{
+ check_common_text(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.49 */
+static inline void check_bearer(const struct stk_common_byte_array *command,
+ const struct stk_common_byte_array *test)
+{
+ check_common_byte_array(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.50 */
+static void check_provisioning_file_reference(const struct stk_file *command,
+ const struct stk_file *test)
+{
+ g_assert(command->len == test->len);
+ g_assert(g_mem_equal(command->file, test->file, test->len));
+}
+
+static void check_provisioning_file_references(GSList *command,
+ const struct stk_file *test)
+{
+ struct stk_file *sf;
+ GSList *l;
+ unsigned int i = 0;
+
+ for (l = command; l; l = l->next) {
+ sf = l->data;
+ check_provisioning_file_reference(sf, &test[i++]);
+ }
+
+ g_assert(test[i].len == 0);
+}
+
/* Defined in TS 102.223 Section 8.60 */
static inline void check_aid(const struct stk_aid *command,
const struct stk_aid *test)
@@ -13835,6 +13878,676 @@ static void test_language_notification(gconstpointer data)
stk_command_free(command);
}
+struct launch_browser_test {
+ const unsigned char *pdu;
+ unsigned int pdu_len;
+ unsigned char qualifier;
+ unsigned char browser_id;
+ char *url;
+ struct stk_common_byte_array bearer;
+ struct stk_file prov_file_refs[MAX_ITEM];
+ char *text_gateway_proxy_id;
+ char *alpha_id;
+ struct stk_icon_id icon_id;
+ struct stk_text_attribute text_attr;
+ struct stk_frame_id frame_id;
+ struct stk_common_byte_array network_name;
+ char *text_usr;
+ char *text_passwd;
+};
+
+static unsigned char launch_browser_111[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_121[] = { 0xD0, 0x1F, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x12, 0x68, 0x74,
+ 0x74, 0x70, 0x3A, 0x2F, 0x2F,
+ 0x78, 0x78, 0x78, 0x2E, 0x79,
+ 0x79, 0x79, 0x2E, 0x7A, 0x7A,
+ 0x7A, 0x05, 0x00 };
+
+static unsigned char launch_browser_131[] = { 0xD0, 0x0E, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x30, 0x01, 0x00, 0x31,
+ 0x00 };
+
+static unsigned char launch_browser_141[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x32, 0x01,
+ 0x03, 0x0D, 0x10, 0x04, 0x61,
+ 0x62, 0x63, 0x2E, 0x64, 0x65,
+ 0x66, 0x2E, 0x67, 0x68, 0x69,
+ 0x2E, 0x6A, 0x6B, 0x6C };
+
+static unsigned char launch_browser_211[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_221[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x03, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_231[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00 };
+
+static unsigned char launch_browser_311[] = { 0xD0, 0x26, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x19,
+ 0x80, 0x04, 0x17, 0x04, 0x14,
+ 0x04, 0x20, 0x04, 0x10, 0x04,
+ 0x12, 0x04, 0x21, 0x04, 0x22,
+ 0x04, 0x12, 0x04, 0x23, 0x04,
+ 0x19, 0x04, 0x22, 0x04, 0x15 };
+
+static unsigned char launch_browser_411[] = { 0xD0, 0x21, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x10,
+ 0x4E, 0x6F, 0x74, 0x20, 0x73,
+ 0x65, 0x6C, 0x66, 0x20, 0x65,
+ 0x78, 0x70, 0x6C, 0x61, 0x6E,
+ 0x2E, 0x1E, 0x02, 0x01, 0x01 };
+
+static unsigned char launch_browser_421[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0C,
+ 0x53, 0x65, 0x6C, 0x66, 0x20,
+ 0x65, 0x78, 0x70, 0x6C, 0x61,
+ 0x6E, 0x2E, 0x1E, 0x02, 0x00,
+ 0x01 };
+
+static unsigned char launch_browser_511[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_512[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_521[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x01, 0xB4 };
+
+static unsigned char launch_browser_522[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_531[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x02, 0xB4 };
+
+static unsigned char launch_browser_532[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_541[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x04, 0xB4 };
+
+static unsigned char launch_browser_542[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_543[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_551[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x08, 0xB4 };
+
+static unsigned char launch_browser_552[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_553[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_561[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x10, 0xB4 };
+
+static unsigned char launch_browser_562[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_563[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_571[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x20, 0xB4 };
+
+static unsigned char launch_browser_572[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_573[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_581[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x40, 0xB4 };
+
+static unsigned char launch_browser_582[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_583[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_591[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x80, 0xB4 };
+
+static unsigned char launch_browser_592[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_593[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_5101[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_5102[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_611[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x05,
+ 0x80, 0x4F, 0x60, 0x59, 0x7D };
+
+static unsigned char launch_browser_711[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x03,
+ 0x80, 0x30, 0xEB };
+
+static struct launch_browser_test launch_browser_data_111 = {
+ .pdu = launch_browser_111,
+ .pdu_len = sizeof(launch_browser_111),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_121 = {
+ .pdu = launch_browser_121,
+ .pdu_len = sizeof(launch_browser_121),
+ .qualifier = 0x00,
+ .url = "http://xxx.yyy.zzz"
+};
+
+static struct launch_browser_test launch_browser_data_131 = {
+ .pdu = launch_browser_131,
+ .pdu_len = sizeof(launch_browser_131),
+ .qualifier = 0x00
+};
+
+static struct launch_browser_test launch_browser_data_141 = {
+ .pdu = launch_browser_141,
+ .pdu_len = sizeof(launch_browser_141),
+ .qualifier = 0x00,
+ .bearer = {
+ .len = 1,
+ .array = (unsigned char *) "\x03"
+ },
+ .text_gateway_proxy_id = "abc.def.ghi.jkl"
+};
+
+static struct launch_browser_test launch_browser_data_211 = {
+ .pdu = launch_browser_211,
+ .pdu_len = sizeof(launch_browser_211),
+ .qualifier = 0x02,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_221 = {
+ .pdu = launch_browser_221,
+ .pdu_len = sizeof(launch_browser_221),
+ .qualifier = 0x03,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_231 = {
+ .pdu = launch_browser_231,
+ .pdu_len = sizeof(launch_browser_231),
+ .qualifier = 0x00
+};
+
+static struct launch_browser_test launch_browser_data_311 = {
+ .pdu = launch_browser_311,
+ .pdu_len = sizeof(launch_browser_311),
+ .qualifier = 0x02,
+ .alpha_id = "ЗДРАВСТВУЙТЕ"
+};
+
+static struct launch_browser_test launch_browser_data_411 = {
+ .pdu = launch_browser_411,
+ .pdu_len = sizeof(launch_browser_411),
+ .qualifier = 0x02,
+ .alpha_id = "Not self explan.",
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct launch_browser_test launch_browser_data_421 = {
+ .pdu = launch_browser_421,
+ .pdu_len = sizeof(launch_browser_421),
+ .qualifier = 0x02,
+ .alpha_id = "Self explan.",
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct launch_browser_test launch_browser_data_511 = {
+ .pdu = launch_browser_511,
+ .pdu_len = sizeof(launch_browser_511),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_512 = {
+ .pdu = launch_browser_512,
+ .pdu_len = sizeof(launch_browser_512),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_521 = {
+ .pdu = launch_browser_521,
+ .pdu_len = sizeof(launch_browser_521),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x01, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_522 = {
+ .pdu = launch_browser_522,
+ .pdu_len = sizeof(launch_browser_522),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_531 = {
+ .pdu = launch_browser_531,
+ .pdu_len = sizeof(launch_browser_531),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x02, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_532 = {
+ .pdu = launch_browser_532,
+ .pdu_len = sizeof(launch_browser_532),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_541 = {
+ .pdu = launch_browser_541,
+ .pdu_len = sizeof(launch_browser_541),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x04, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_542 = {
+ .pdu = launch_browser_542,
+ .pdu_len = sizeof(launch_browser_542),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_543 = {
+ .pdu = launch_browser_543,
+ .pdu_len = sizeof(launch_browser_543),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_551 = {
+ .pdu = launch_browser_551,
+ .pdu_len = sizeof(launch_browser_551),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x08, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_552 = {
+ .pdu = launch_browser_552,
+ .pdu_len = sizeof(launch_browser_552),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_553 = {
+ .pdu = launch_browser_553,
+ .pdu_len = sizeof(launch_browser_553),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_561 = {
+ .pdu = launch_browser_561,
+ .pdu_len = sizeof(launch_browser_561),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x10, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_562 = {
+ .pdu = launch_browser_562,
+ .pdu_len = sizeof(launch_browser_562),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_563 = {
+ .pdu = launch_browser_563,
+ .pdu_len = sizeof(launch_browser_563),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_571 = {
+ .pdu = launch_browser_571,
+ .pdu_len = sizeof(launch_browser_571),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x20, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_572 = {
+ .pdu = launch_browser_572,
+ .pdu_len = sizeof(launch_browser_572),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_573 = {
+ .pdu = launch_browser_573,
+ .pdu_len = sizeof(launch_browser_573),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_581 = {
+ .pdu = launch_browser_581,
+ .pdu_len = sizeof(launch_browser_581),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x40, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_582 = {
+ .pdu = launch_browser_582,
+ .pdu_len = sizeof(launch_browser_582),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_583 = {
+ .pdu = launch_browser_583,
+ .pdu_len = sizeof(launch_browser_583),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_591 = {
+ .pdu = launch_browser_591,
+ .pdu_len = sizeof(launch_browser_591),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x80, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_592 = {
+ .pdu = launch_browser_592,
+ .pdu_len = sizeof(launch_browser_592),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_593 = {
+ .pdu = launch_browser_593,
+ .pdu_len = sizeof(launch_browser_593),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_5101 = {
+ .pdu = launch_browser_5101,
+ .pdu_len = sizeof(launch_browser_5101),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_5102 = {
+ .pdu = launch_browser_5102,
+ .pdu_len = sizeof(launch_browser_5102),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_611 = {
+ .pdu = launch_browser_611,
+ .pdu_len = sizeof(launch_browser_611),
+ .qualifier = 0x02,
+ .alpha_id = "你好"
+};
+
+static struct launch_browser_test launch_browser_data_711 = {
+ .pdu = launch_browser_711,
+ .pdu_len = sizeof(launch_browser_711),
+ .qualifier = 0x02,
+ .alpha_id = "ル"
+};
+
+static void test_launch_browser(gconstpointer data)
+{
+ const struct launch_browser_test *test = data;
+ struct stk_command *command;
+
+ command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+ g_assert(command);
+
+ g_assert(command->number == 1);
+ g_assert(command->type == STK_COMMAND_TYPE_LAUNCH_BROWSER);
+ g_assert(command->qualifier == test->qualifier);
+
+ g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+ g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+ check_browser_id(command->launch_browser.browser_id, test->browser_id);
+ check_url(command->launch_browser.url, test->url);
+ check_bearer(&command->launch_browser.bearer, &test->bearer);
+ check_provisioning_file_references(
+ command->launch_browser.prov_file_refs, test->prov_file_refs);
+ check_text(command->launch_browser.text_gateway_proxy_id,
+ test->text_gateway_proxy_id);
+ check_alpha_id(command->launch_browser.alpha_id, test->alpha_id);
+ check_icon_id(&command->launch_browser.icon_id, &test->icon_id);
+ check_text_attr(&command->launch_browser.text_attr, &test->text_attr);
+ check_frame_id(&command->launch_browser.frame_id, &test->frame_id);
+ check_text(command->launch_browser.text_usr, test->text_usr);
+ check_text(command->launch_browser.text_passwd, test->text_passwd);
+
+ stk_command_free(command);
+}
+
struct terminal_response_test {
const unsigned char *pdu;
unsigned int pdu_len;
@@ -17246,5 +17959,82 @@ int main(int argc, char **argv)
g_test_add_data_func("/teststk/Language Notification 1.2.1",
&language_notification_data_121, test_language_notification);
+ g_test_add_data_func("/teststk/Launch Browser 1.1.1",
+ &launch_browser_data_111, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.2.1",
+ &launch_browser_data_121, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.3.1",
+ &launch_browser_data_131, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.4.1",
+ &launch_browser_data_141, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.1.1",
+ &launch_browser_data_211, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.2.1",
+ &launch_browser_data_221, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.3.1",
+ &launch_browser_data_231, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 3.1.1",
+ &launch_browser_data_311, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 4.1.1",
+ &launch_browser_data_411, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 4.2.1",
+ &launch_browser_data_421, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.1.1",
+ &launch_browser_data_511, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.1.2",
+ &launch_browser_data_512, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.2.1",
+ &launch_browser_data_521, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.2.2",
+ &launch_browser_data_522, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.3.1",
+ &launch_browser_data_531, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.3.2",
+ &launch_browser_data_532, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.1",
+ &launch_browser_data_541, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.2",
+ &launch_browser_data_542, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.3",
+ &launch_browser_data_543, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.1",
+ &launch_browser_data_551, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.2",
+ &launch_browser_data_552, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.3",
+ &launch_browser_data_553, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.1",
+ &launch_browser_data_561, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.2",
+ &launch_browser_data_562, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.3",
+ &launch_browser_data_563, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.1",
+ &launch_browser_data_571, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.2",
+ &launch_browser_data_572, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.3",
+ &launch_browser_data_573, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.1",
+ &launch_browser_data_581, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.2",
+ &launch_browser_data_582, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.3",
+ &launch_browser_data_583, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.1",
+ &launch_browser_data_591, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.2",
+ &launch_browser_data_592, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.3",
+ &launch_browser_data_593, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.10.1",
+ &launch_browser_data_5101, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.10.2",
+ &launch_browser_data_5102, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 6.1.1",
+ &launch_browser_data_611, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 7.1.1",
+ &launch_browser_data_711, test_launch_browser);
+
return g_test_run();
}
--
1.7.0.4
next prev parent reply other threads:[~2010-05-26 14:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
2010-05-26 14:39 ` [PATCH 2/8] stk: Add parser for launch browser commands Yang Gu
2010-05-26 14:39 ` [PATCH 3/8] teststk: Add check of len in byte array Yang Gu
2010-05-26 14:39 ` [PATCH 4/8] teststk: Use check_common_text() to check string Yang Gu
2010-05-26 14:39 ` [PATCH 5/8] stk: Fix the parser of send sms Yang Gu
2010-05-26 14:39 ` [PATCH 6/8] teststk: Add cases for send sms parser Yang Gu
2010-05-26 14:39 ` Yang Gu [this message]
2010-05-26 14:39 ` [PATCH 8/8] Move destructor prior to return Yang Gu
2010-05-27 17:48 ` [PATCH 1/8] stk: Make parse_dataobj not consume extra data Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274884754-12977-7-git-send-email-yang.gu@intel.com \
--to=gyagp0@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.