---
 unit/test-stkutil.c |  778 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 778 insertions(+), 0 deletions(-)

diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 7574fa1..2f2a725 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -2142,6 +2142,717 @@ static const struct terminal_response_test 
get_inkey_response_data_1311 = {
        },
 };
 
+static const unsigned char get_input_response_111[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x31,
+       0x32, 0x33, 0x34, 0x35,
+};
+
+static const struct terminal_response_test get_input_response_data_111 = {
+       .pdu = get_input_response_111,
+       .pdu_len = sizeof(get_input_response_111),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "12345",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_121[] = {
+       0x81, 0x03, 0x01, 0x23, 0x08, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x00, 0xb6,
+       0x9b, 0x6a, 0xb4, 0x02,
+};
+
+static const struct terminal_response_test get_input_response_data_121 = {
+       .pdu = get_input_response_121,
+       .pdu_len = sizeof(get_input_response_121),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x08,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "67*#+",
+                               .packed = TRUE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_131[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x41,
+       0x62, 0x43, 0x64, 0x45,
+};
+
+static const struct terminal_response_test get_input_response_data_131 = {
+       .pdu = get_input_response_131,
+       .pdu_len = sizeof(get_input_response_131),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x01,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "AbCdE",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_141[] = {
+       0x81, 0x03, 0x01, 0x23, 0x04, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x08, 0x04, 0x32,
+       0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
+};
+
+static const struct terminal_response_test get_input_response_data_141 = {
+       .pdu = get_input_response_141,
+       .pdu_len = sizeof(get_input_response_141),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x04,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "2345678",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_151[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x15, 0x04, 0x31,
+       0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+       0x38, 0x39, 0x30,
+};
+
+static const struct terminal_response_test get_input_response_data_151 = {
+       .pdu = get_input_response_151,
+       .pdu_len = sizeof(get_input_response_151),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "12345678901234567890",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_161[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x11,
+};
+
+static const struct terminal_response_test get_input_response_data_161 = {
+       .pdu = get_input_response_161,
+       .pdu_len = sizeof(get_input_response_161),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_GO_BACK,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = NO_TEXT,
+               }},
+       },
+};
+
+static const unsigned char get_input_response_171[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x10,
+};
+
+static const struct terminal_response_test get_input_response_data_171 = {
+       .pdu = get_input_response_171,
+       .pdu_len = sizeof(get_input_response_171),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_USER_TERMINATED,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = NO_TEXT,
+               }},
+       },
+};
+
+static const unsigned char get_input_response_181[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0xa1, 0x04,
+       0x2a, 0x2a, 0x2a, 0x31, 0x31, 0x31, 0x31, 0x31,
+       0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x32, 0x32, 0x32, 0x32, 0x32,
+       0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x33, 0x33, 0x33, 0x33, 0x33,
+       0x33, 0x33, 0x33, 0x33, 0x33, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x34, 0x34, 0x34, 0x34, 0x34,
+       0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x35, 0x35, 0x35, 0x35, 0x35,
+       0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x36, 0x36, 0x36, 0x36, 0x36,
+       0x36, 0x36, 0x36, 0x36, 0x36, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x37, 0x37, 0x37, 0x37, 0x37,
+       0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x38, 0x38, 0x38, 0x38, 0x38,
+       0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x39, 0x39, 0x39, 0x39, 0x39,
+       0x39, 0x39, 0x39, 0x39, 0x39, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x30, 0x30, 0x30, 0x30, 0x30,
+       0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23,
+};
+
+static const struct terminal_response_test get_input_response_data_181 = {
+       .pdu = get_input_response_181,
+       .pdu_len = sizeof(get_input_response_181),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "***1111111111###***2222222222###"
+                                       "***3333333333###***4444444444###"
+                                       "***5555555555###***6666666666###"
+                                       "***7777777777###***8888888888###"
+                                       "***9999999999###***0000000000###",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_191a[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x01, 0x04,
+};
+
+static const unsigned char get_input_response_191b[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x00,
+};
+
+static const struct terminal_response_test get_input_response_data_191 = {
+       /* Either get_input_response_191a or get_input_response_191b is ok */
+       .pdu = get_input_response_191a,
+       .pdu_len = sizeof(get_input_response_191a),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x01,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_211[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x12,
+};
+
+static const struct terminal_response_test get_input_response_data_211 = {
+       .pdu = get_input_response_211,
+       .pdu_len = sizeof(get_input_response_211),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_NO_RESPONSE,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = NO_TEXT,
+               }},
+       },
+};
+
+static const unsigned char get_input_response_311[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x48,
+       0x45, 0x4c, 0x4c, 0x4f,
+};
+
+static const struct terminal_response_test get_input_response_data_311 = {
+       .pdu = get_input_response_311,
+       .pdu_len = sizeof(get_input_response_311),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x01,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "HELLO",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_411[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x19, 0x08, 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 const struct terminal_response_test get_input_response_data_411 = {
+       .pdu = get_input_response_411,
+       .pdu_len = sizeof(get_input_response_411),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "ЗДРАВСТВУЙТЕ",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_421[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
+       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
+       0x04, 0x23, 0x04, 0x19,
+};
+
+static const struct terminal_response_test get_input_response_data_421 = {
+       .pdu = get_input_response_421,
+       .pdu_len = sizeof(get_input_response_421),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = 
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                                       
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                                       
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙ",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_611a[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x2b,
+};
+
+static const struct terminal_response_test get_input_response_data_611a = {
+       .pdu = get_input_response_611a,
+       .pdu_len = sizeof(get_input_response_611a),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "+",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_611b[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x04, 0x8d, 0x02, 0x04, 0x2b,
+};
+
+static const struct terminal_response_test get_input_response_data_611b = {
+       .pdu = get_input_response_611b,
+       .pdu_len = sizeof(get_input_response_611b),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_NO_ICON,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "+",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_711[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x13,
+};
+
+static const struct terminal_response_test get_input_response_data_711 = {
+       .pdu = get_input_response_711,
+       .pdu_len = sizeof(get_input_response_711),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_HELP_REQUESTED,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = NO_TEXT,
+               }},
+       },
+};
+
+static const unsigned char get_input_response_812[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x32,
+       0x32, 0x32, 0x32, 0x32,
+};
+
+static const struct terminal_response_test get_input_response_data_812 = {
+       .pdu = get_input_response_812,
+       .pdu_len = sizeof(get_input_response_812),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "22222",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_843[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x33,
+       0x33, 0x33, 0x33, 0x33,
+};
+
+static const struct terminal_response_test get_input_response_data_843 = {
+       .pdu = get_input_response_843,
+       .pdu_len = sizeof(get_input_response_843),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x00,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "33333",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_1011[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x4f,
+       0x60, 0x59, 0x7d,
+};
+
+static const struct terminal_response_test get_input_response_data_1011 = {
+       .pdu = get_input_response_1011,
+       .pdu_len = sizeof(get_input_response_1011),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "你好",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_1021[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d,
+};
+
+static const struct terminal_response_test get_input_response_data_1021 = {
+       .pdu = get_input_response_1021,
+       .pdu_len = sizeof(get_input_response_1021),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "你好你好你好你好你好你好"
+                                       "你好你好你好你好你好你好"
+                                       "你好你好你好你好你好你好"
+                                       "你好你好你好你好你好你好"
+                                       "你好你好你好你好你好你好"
+                                       "你好你好你好你好你好",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_1211[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x30,
+       0xeb, 0x30, 0xeb,
+};
+
+static const struct terminal_response_test get_input_response_data_1211 = {
+       .pdu = get_input_response_1211,
+       .pdu_len = sizeof(get_input_response_1211),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "ルル",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
+static const unsigned char get_input_response_1221[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
+       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb,
+};
+
+static const struct terminal_response_test get_input_response_data_1221 = {
+       .pdu = get_input_response_1221,
+       .pdu_len = sizeof(get_input_response_1221),
+       .response = {
+               .number = 1,
+               .type = STK_COMMAND_TYPE_GET_INPUT,
+               .qualifier = 0x03,
+               .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+               .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+               .result = {
+                       .type = STK_RESULT_TYPE_SUCCESS,
+                       .additional_len = 0,
+               },
+               { .get_input = {
+                       .text = {
+                               .text = "ルルルルルルルルルルルル"
+                                       "ルルルルルルルルルルルル"
+                                       "ルルルルルルルルルルルル"
+                                       "ルルルルルルルルルルルル"
+                                       "ルルルルルルルルルルルル"
+                                       "ルルルルルルルルルル",
+                               .packed = FALSE,
+                               .yesno = FALSE,
+                       },
+               }},
+       },
+};
+
 int main(int argc, char **argv)
 {
        g_test_init(&argc, &argv, NULL);
@@ -2361,6 +3072,73 @@ int main(int argc, char **argv)
        g_test_add_data_func("/teststk/Get Input 1.1.1",
                                &get_input_data_111, test_get_input);
 
+       g_test_add_data_func("/teststk/Get Input response 1.1.1",
+                               &get_input_response_data_111,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.2.1",
+                               &get_input_response_data_121,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.3.1",
+                               &get_input_response_data_131,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.4.1",
+                               &get_input_response_data_141,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.5.1",
+                               &get_input_response_data_151,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.6.1",
+                               &get_input_response_data_161,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.7.1",
+                               &get_input_response_data_171,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.8.1",
+                               &get_input_response_data_181,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 1.9.1",
+                               &get_input_response_data_191,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 2.1.1",
+                               &get_input_response_data_211,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 3.1.1",
+                               &get_input_response_data_311,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 4.1.1",
+                               &get_input_response_data_411,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 4.2.1",
+                               &get_input_response_data_421,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 6.1.1A",
+                               &get_input_response_data_611a,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 6.1.1B",
+                               &get_input_response_data_611b,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 7.1.1",
+                               &get_input_response_data_711,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 8.1.2",
+                               &get_input_response_data_812,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 8.4.3",
+                               &get_input_response_data_843,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 10.1.1",
+                               &get_input_response_data_1011,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 10.2.1",
+                               &get_input_response_data_1021,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 12.1.1",
+                               &get_input_response_data_1211,
+                               test_terminal_response_encoding);
+       g_test_add_data_func("/teststk/Get Input response 12.2.1",
+                               &get_input_response_data_1221,
+                               test_terminal_response_encoding);
+
        g_test_add_data_func("/teststk/More Time 1.1.1",
                                &more_time_data_111, test_more_time);
 
-- 
1.6.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to