summaryrefslogtreecommitdiffstats
path: root/unit
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-06-07 12:08:31 +0200
committerDenis Kenzior <denkenz@gmail.com>2010-06-09 12:30:58 -0500
commit6120e487b5d8cc946ea35a68cdda2a3897adde68 (patch)
tree5a389514f204737ab92b8a9e259868b9c700d59a /unit
parentb2dfa2321ffab1851775ce611438663ebcc8804a (diff)
downloadofono-6120e487b5d8cc946ea35a68cdda2a3897adde68.tar.bz2
test-stkutil: Menu Selection envelope tests
Diffstat (limited to 'unit')
-rw-r--r--unit/test-stkutil.c162
1 files changed, 162 insertions, 0 deletions
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index ac6db517..2a33c309 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -18158,6 +18158,151 @@ static const struct envelope_test cbs_pp_data_download_data_17 = {
},
};
+static const unsigned char menu_selection_111[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x02,
+};
+
+static const struct envelope_test menu_selection_data_111 = {
+ .pdu = menu_selection_111,
+ .pdu_len = sizeof(menu_selection_111),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x2,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_112[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x12,
+};
+
+static const struct envelope_test menu_selection_data_112 = {
+ .pdu = menu_selection_112,
+ .pdu_len = sizeof(menu_selection_112),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x12,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_121[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x3d,
+};
+
+static const struct envelope_test menu_selection_data_121 = {
+ .pdu = menu_selection_121,
+ .pdu_len = sizeof(menu_selection_121),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x3d,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_122[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0xfb,
+};
+
+static const struct envelope_test menu_selection_data_122 = {
+ .pdu = menu_selection_122,
+ .pdu_len = sizeof(menu_selection_122),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0xfb,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_123[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x01,
+};
+
+static const struct envelope_test menu_selection_data_123 = {
+ .pdu = menu_selection_123,
+ .pdu_len = sizeof(menu_selection_123),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x1,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_211[] = {
+ 0xd3, 0x09, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x02, 0x15, 0x00,
+};
+
+static const struct envelope_test menu_selection_data_211 = {
+ .pdu = menu_selection_211,
+ .pdu_len = sizeof(menu_selection_211),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x2,
+ .help_request = TRUE,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_612[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x05,
+};
+
+static const struct envelope_test menu_selection_data_612 = {
+ .pdu = menu_selection_612,
+ .pdu_len = sizeof(menu_selection_612),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x5,
+ }},
+ },
+};
+
+static const unsigned char menu_selection_641[] = {
+ 0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
+ 0x08,
+};
+
+static const struct envelope_test menu_selection_data_641 = {
+ .pdu = menu_selection_641,
+ .pdu_len = sizeof(menu_selection_641),
+ .envelope = {
+ .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
+ .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ { .menu_selection = {
+ .item_id = 0x8,
+ }},
+ },
+};
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -19843,5 +19988,22 @@ int main(int argc, char **argv)
g_test_add_data_func("/teststk/CBS-PP data download 1.7",
&cbs_pp_data_download_data_17, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 1.1.1",
+ &menu_selection_data_111, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 1.1.2",
+ &menu_selection_data_112, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 1.2.1",
+ &menu_selection_data_121, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 1.2.2",
+ &menu_selection_data_122, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 1.2.3",
+ &menu_selection_data_123, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 2.1.1",
+ &menu_selection_data_211, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 6.1.2",
+ &menu_selection_data_612, test_envelope_encoding);
+ g_test_add_data_func("/teststk/Menu Selection 6.4.1",
+ &menu_selection_data_641, test_envelope_encoding);
+
return g_test_run();
}