From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7339091034948270431==" MIME-Version: 1.0 From: Yang Gu Subject: [PATCH 02/19] test-stkutil: Add unit test for get input parser Date: Mon, 10 May 2010 18:38:45 +0800 Message-ID: <1273487942-27213-2-git-send-email-yang.gu@intel.com> In-Reply-To: <1273487942-27213-1-git-send-email-yang.gu@intel.com> List-Id: To: ofono@ofono.org --===============7339091034948270431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- unit/test-stkutil.c | 1412 +++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 files changed, 1392 insertions(+), 20 deletions(-) diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c index 82f2a1c..abb82c9 100644 --- a/unit/test-stkutil.c +++ b/unit/test-stkutil.c @@ -60,9 +60,23 @@ static void check_duration(const struct stk_duration *co= mmand, g_assert(command->interval =3D=3D test->interval); } = +/* Defined in TS 102.223 Section 8.11 */ +static void check_response_length(const struct stk_response_length *comman= d, + const struct stk_response_length *test) +{ + g_assert(command->min =3D=3D test->min); + g_assert(command->max =3D=3D test->max); +} + /* Defined in TS 102.223 Section 8.15 */ static inline void check_text(const char *command, const char *test) { + if (test =3D=3D NULL) { + g_assert(command =3D=3D NULL); + return; + } + + g_assert(command !=3D NULL); g_assert(g_str_equal(command, test)); } = @@ -1284,11 +1298,12 @@ struct get_input_test { const unsigned char *pdu; unsigned int pdu_len; unsigned char qualifier; - const char *expected; - unsigned char min; - unsigned char max; - unsigned char icon_qualifier; - unsigned char icon_id; + char *text; + struct stk_response_length response_length; + char *default_text; + struct stk_icon_id icon_id; + struct stk_text_attribute text_attribute; + struct stk_frame_id frame_id; }; = static unsigned char get_input_111[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, @@ -1298,13 +1313,1262 @@ static unsigned char get_input_111[] =3D { 0xD0, = 0x1B, 0x81, 0x03, 0x01, 0x23, 0x32, 0x33, 0x34, 0x35, 0x91, 0x02, 0x05, 0x05 }; = +static unsigned char get_input_121[] =3D { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0= x23, + 0x08, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0B, 0x00, 0x45, 0x37, + 0xBD, 0x2C, 0x07, 0xD9, 0x6E, + 0xAA, 0xD1, 0x0A, 0x91, 0x02, + 0x05, 0x05 }; + +static unsigned char get_input_131[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x01, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x41, + 0x62, 0x43, 0x64, 0x45, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_141[] =3D { 0xD0, 0x27, 0x81, 0x03, 0x01, 0= x23, + 0x04, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x18, 0x04, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6F, 0x72, + 0x64, 0x20, 0x31, 0x3C, 0x53, + 0x45, 0x4E, 0x44, 0x3E, 0x32, + 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x91, 0x02, 0x04, 0x08 }; + +static unsigned char get_input_151[] =3D { 0xD0, 0x24, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x15, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x2E, 0x2E, 0x39, 0x2C, 0x30, + 0x2E, 0x2E, 0x39, 0x2C, 0x30, + 0x28, 0x31, 0x29, 0x91, 0x02, + 0x01, 0x14 }; + +static unsigned char get_input_161[] =3D { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0F, 0x04, 0x3C, 0x47, + 0x4F, 0x2D, 0x42, 0x41, 0x43, + 0x4B, 0x57, 0x41, 0x52, 0x44, + 0x53, 0x3E, 0x91, 0x02, 0x00, + 0x08 }; + +static unsigned char get_input_171[] =3D { 0xD0, 0x17, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x08, 0x04, 0x3C, 0x41, + 0x42, 0x4F, 0x52, 0x54, 0x3E, + 0x91, 0x02, 0x00, 0x08 }; + +static unsigned char get_input_181[] =3D { 0xD0, 0x81, 0xB1, 0x81, 0x03, 0= x01, + 0x23, 0x00, 0x82, 0x02, 0x81, + 0x82, 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, + 0x91, 0x02, 0xA0, 0xA0 }; + +static unsigned char get_input_191[] =3D { 0xD0, 0x16, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x07, 0x04, 0x3C, 0x53, + 0x45, 0x4E, 0x44, 0x3E, 0x91, + 0x02, 0x00, 0x01 }; + +static unsigned char get_input_1101[] =3D { 0xD0, 0x0F, 0x81, 0x03, 0x01, = 0x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x00, 0x91, 0x02, 0x01, + 0x05 }; + +static unsigned char get_input_211[] =3D { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0B, 0x04, 0x3C, 0x54, + 0x49, 0x4D, 0x45, 0x2D, 0x4F, + 0x55, 0x54, 0x3E, 0x91, 0x02, + 0x00, 0x0A }; + +static unsigned char get_input_311[] =3D { 0xD0, 0x28, 0x81, 0x03, 0x01, 0= x23, + 0x01, 0x82, 0x02, 0x81, 0x82, + 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, 0x91, 0x02, 0x05, + 0x05 }; + +static unsigned char get_input_321[] =3D { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0= x01, + 0x23, 0x01, 0x82, 0x02, 0x81, + 0x82, 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, + 0x91, 0x02, 0x05, 0x05 }; + +static unsigned char get_input_411[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x0C, 0x0C }; + +static unsigned char get_input_421[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x05, 0xFF }; + +static unsigned char get_input_511[] =3D { 0xD0, 0x23, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0x17, 0x06, + 0x04, 0x31, 0x32, 0x33, 0x34, + 0x35 }; + +static unsigned char get_input_521[] =3D { 0xD0, 0x81, 0xBA, 0x81, 0x03, 0= x01, + 0x23, 0x00, 0x82, 0x02, 0x81, + 0x82, 0x8D, 0x07, 0x04, 0x45, + 0x6E, 0x74, 0x65, 0x72, 0x3A, + 0x91, 0x02, 0xA0, 0xA0, 0x17, + 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 unsigned char get_input_611[] =3D { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0A, 0x04, 0x3C, 0x4E, + 0x4F, 0x2D, 0x49, 0x43, 0x4F, + 0x4E, 0x3E, 0x91, 0x02, 0x00, + 0x0A, 0x1E, 0x02, 0x00, 0x01 }; + +static unsigned char get_input_621[] =3D { 0xD0, 0x20, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0D, 0x04, 0x3C, 0x42, + 0x41, 0x53, 0x49, 0x43, 0x2D, + 0x49, 0x43, 0x4F, 0x4E, 0x3E, + 0x91, 0x02, 0x00, 0x0A, 0x1E, + 0x02, 0x01, 0x01 }; + +static unsigned char get_input_631[] =3D { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0A, 0x04, 0x3C, 0x4E, + 0x4F, 0x2D, 0x49, 0x43, 0x4F, + 0x4E, 0x3E, 0x91, 0x02, 0x00, + 0x0A, 0x1E, 0x02, 0x00, 0x02 }; + +static unsigned char get_input_641[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0E, 0x04, 0x3C, 0x43, + 0x4F, 0x4C, 0x4F, 0x55, 0x52, + 0x2D, 0x49, 0x43, 0x4F, 0x4E, + 0x3E, 0x91, 0x02, 0x00, 0x0A, + 0x1E, 0x02, 0x01, 0x02 }; + +static unsigned char get_input_711[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x80, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_811[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_812[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_821[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x01, 0xB4 }; + +static unsigned char get_input_822[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_831[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x02, 0xB4 }; + +static unsigned char get_input_832[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_841[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x04, 0xB4 }; + +static unsigned char get_input_842[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_843[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_851[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x08, 0xB4 }; + +static unsigned char get_input_852[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_853[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_861[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x10, 0xB4 }; + +static unsigned char get_input_862[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_863[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_871[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x20, 0xB4 }; + +static unsigned char get_input_872[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_873[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_881[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x40, 0xB4 }; + +static unsigned char get_input_882[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_883[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_891[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x80, 0xB4 }; + +static unsigned char get_input_892[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_893[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0= x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_8101[] =3D { 0xD0, 0x21, 0x81, 0x03, 0x01, = 0x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x31, + 0x32, 0x33, 0x34, 0x35, 0x91, + 0x02, 0x05, 0x05, 0xD0, 0x04, + 0x00, 0x0B, 0x00, 0xB4 }; + +static unsigned char get_input_8102[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, = 0x23, + 0x00, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x32, + 0x32, 0x32, 0x32, 0x32, 0x91, + 0x02, 0x05, 0x05 }; + +static unsigned char get_input_911[] =3D { 0xD0, 0x14, 0x81, 0x03, 0x01, 0= x23, + 0x01, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x05, 0x08, 0x4F, 0x60, + 0x59, 0x7D, 0x91, 0x02, 0x05, + 0x05 }; + +static unsigned char get_input_921[] =3D { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0= x01, + 0x23, 0x01, 0x82, 0x02, 0x81, + 0x82, 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, + 0x91, 0x02, 0x05, 0x05 }; + +static unsigned char get_input_1011[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, = 0x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x02, 0x02 }; + +static unsigned char get_input_1021[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, = 0x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x05, 0xFF }; + +static unsigned char get_input_1111[] =3D { 0xD0, 0x12, 0x81, 0x03, 0x01, = 0x23, + 0x01, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x03, 0x08, 0x30, 0xEB, + 0x91, 0x02, 0x05, 0x05 }; + +static unsigned char get_input_1121[] =3D { 0xD0, 0x81, 0x9D, 0x81, 0x03, = 0x01, + 0x23, 0x01, 0x82, 0x02, 0x81, + 0x82, 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, + 0x91, 0x02, 0x05, 0x05 }; + +static unsigned char get_input_1211[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, = 0x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x02, 0x02 }; + +static unsigned char get_input_1221[] =3D { 0xD0, 0x1B, 0x81, 0x03, 0x01, = 0x23, + 0x03, 0x82, 0x02, 0x81, 0x82, + 0x8D, 0x0C, 0x04, 0x45, 0x6E, + 0x74, 0x65, 0x72, 0x20, 0x48, + 0x65, 0x6C, 0x6C, 0x6F, 0x91, + 0x02, 0x05, 0xFF }; + static struct get_input_test get_input_data_111 =3D { .pdu =3D get_input_111, .pdu_len =3D sizeof(get_input_111), - .expected =3D "Enter 12345", .qualifier =3D 0x00, - .min =3D 5, - .max =3D 5 + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_121 =3D { + .pdu =3D get_input_121, + .pdu_len =3D sizeof(get_input_121), + .qualifier =3D 0x08, + .text =3D "Enter 67*#+", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_131 =3D { + .pdu =3D get_input_131, + .pdu_len =3D sizeof(get_input_131), + .qualifier =3D 0x01, + .text =3D "Enter AbCdE", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_141 =3D { + .pdu =3D get_input_141, + .pdu_len =3D sizeof(get_input_141), + .qualifier =3D 0x04, + .text =3D "Password 12345678", + .response_length =3D { + .min =3D 4, + .max =3D 8 + } +}; + +static struct get_input_test get_input_data_151 =3D { + .pdu =3D get_input_151, + .pdu_len =3D sizeof(get_input_151), + .qualifier =3D 0x00, + .text =3D "Enter 1..9,0..9,0(1)", + .response_length =3D { + .min =3D 1, + .max =3D 20 + } +}; + +static struct get_input_test get_input_data_161 =3D { + .pdu =3D get_input_161, + .pdu_len =3D sizeof(get_input_161), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 8 + } +}; + +static struct get_input_test get_input_data_171 =3D { + .pdu =3D get_input_171, + .pdu_len =3D sizeof(get_input_171), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 8 + } +}; + +static struct get_input_test get_input_data_181 =3D { + .pdu =3D get_input_181, + .pdu_len =3D sizeof(get_input_181), + .qualifier =3D 0x00, + .text =3D "***1111111111###***2222222222###***3333333333###" + "***4444444444###***5555555555###***6666666666###" + "***7777777777###***8888888888###***9999999999###" + "***0000000000###", + .response_length =3D { + .min =3D 160, + .max =3D 160 + } +}; + +static struct get_input_test get_input_data_191 =3D { + .pdu =3D get_input_191, + .pdu_len =3D sizeof(get_input_191), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 1 + } +}; + +static struct get_input_test get_input_data_1101 =3D { + .pdu =3D get_input_1101, + .pdu_len =3D sizeof(get_input_1101), + .qualifier =3D 0x00, + .text =3D NULL, + .response_length =3D { + .min =3D 1, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_211 =3D { + .pdu =3D get_input_211, + .pdu_len =3D sizeof(get_input_211), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 10 + } +}; + +static struct get_input_test get_input_data_311 =3D { + .pdu =3D get_input_311, + .pdu_len =3D sizeof(get_input_311), + .qualifier =3D 0x01, + .text =3D "=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99= =D0=A2=D0=95", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_321 =3D { + .pdu =3D get_input_321, + .pdu_len =3D sizeof(get_input_321), + .qualifier =3D 0x01, + .text =3D "=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99= =D0=A2=D0=95=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99=D0= =A2=D0=95" + "=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99=D0=A2=D0= =95=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99=D0=A2=D0=95" + "=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99=D0=A2=D0= =95=D0=97=D0=94=D0=A0=D0=90=D0=92=D0=A1=D0=A2=D0=92=D0=A3=D0=99", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_411 =3D { + .pdu =3D get_input_411, + .pdu_len =3D sizeof(get_input_411), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 12, + .max =3D 12 + } +}; + +static struct get_input_test get_input_data_421 =3D { + .pdu =3D get_input_421, + .pdu_len =3D sizeof(get_input_421), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 5, + .max =3D 0xFF + } +}; + +static struct get_input_test get_input_data_511 =3D { + .pdu =3D get_input_511, + .pdu_len =3D sizeof(get_input_511), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .default_text =3D "12345" +}; + +static struct get_input_test get_input_data_521 =3D { + .pdu =3D get_input_521, + .pdu_len =3D sizeof(get_input_521), + .qualifier =3D 0x00, + .text =3D "Enter:", + .response_length =3D { + .min =3D 160, + .max =3D 160 + }, + .default_text =3D "***1111111111###***2222222222###***3333333333###" + "***4444444444###***5555555555###***6666666666###" + "***7777777777###***8888888888###***9999999999###" + "***0000000000###" +}; + +static struct get_input_test get_input_data_611 =3D { + .pdu =3D get_input_611, + .pdu_len =3D sizeof(get_input_611), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 10 + }, + .icon_id =3D { + .qualifier =3D STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY, + .id =3D 0x01 + } +}; + +static struct get_input_test get_input_data_621 =3D { + .pdu =3D get_input_621, + .pdu_len =3D sizeof(get_input_621), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 10 + }, + .icon_id =3D { + .qualifier =3D STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY, + .id =3D 0x01 + } +}; + +static struct get_input_test get_input_data_631 =3D { + .pdu =3D get_input_631, + .pdu_len =3D sizeof(get_input_631), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 10 + }, + .icon_id =3D { + .qualifier =3D STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY, + .id =3D 0x02 + } +}; + +static struct get_input_test get_input_data_641 =3D { + .pdu =3D get_input_641, + .pdu_len =3D sizeof(get_input_641), + .qualifier =3D 0x00, + .text =3D "", + .response_length =3D { + .min =3D 0, + .max =3D 10 + }, + .icon_id =3D { + .qualifier =3D STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY, + .id =3D 0x02 + } +}; + +static struct get_input_test get_input_data_711 =3D { + .pdu =3D get_input_711, + .pdu_len =3D sizeof(get_input_711), + .qualifier =3D 0x80, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_811 =3D { + .pdu =3D get_input_811, + .pdu_len =3D sizeof(get_input_811), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_812 =3D { + .pdu =3D get_input_812, + .pdu_len =3D sizeof(get_input_812), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_821 =3D { + .pdu =3D get_input_821, + .pdu_len =3D sizeof(get_input_821), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x01, 0xB4 } + } +}; + +static struct get_input_test get_input_data_822 =3D { + .pdu =3D get_input_822, + .pdu_len =3D sizeof(get_input_822), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_831 =3D { + .pdu =3D get_input_831, + .pdu_len =3D sizeof(get_input_831), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x02, 0xB4 } + } +}; + +static struct get_input_test get_input_data_832 =3D { + .pdu =3D get_input_832, + .pdu_len =3D sizeof(get_input_832), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_841 =3D { + .pdu =3D get_input_841, + .pdu_len =3D sizeof(get_input_841), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x04, 0xB4 } + } +}; + +static struct get_input_test get_input_data_842 =3D { + .pdu =3D get_input_842, + .pdu_len =3D sizeof(get_input_842), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_843 =3D { + .pdu =3D get_input_843, + .pdu_len =3D sizeof(get_input_843), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_851 =3D { + .pdu =3D get_input_851, + .pdu_len =3D sizeof(get_input_851), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x08, 0xB4 } + } +}; + +static struct get_input_test get_input_data_852 =3D { + .pdu =3D get_input_852, + .pdu_len =3D sizeof(get_input_852), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_853 =3D { + .pdu =3D get_input_853, + .pdu_len =3D sizeof(get_input_853), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_861 =3D { + .pdu =3D get_input_861, + .pdu_len =3D sizeof(get_input_861), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x10, 0xB4 } + } +}; + +static struct get_input_test get_input_data_862 =3D { + .pdu =3D get_input_862, + .pdu_len =3D sizeof(get_input_862), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_863 =3D { + .pdu =3D get_input_863, + .pdu_len =3D sizeof(get_input_863), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_871 =3D { + .pdu =3D get_input_871, + .pdu_len =3D sizeof(get_input_871), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x20, 0xB4 } + } +}; + +static struct get_input_test get_input_data_872 =3D { + .pdu =3D get_input_872, + .pdu_len =3D sizeof(get_input_872), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_873 =3D { + .pdu =3D get_input_873, + .pdu_len =3D sizeof(get_input_873), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_881 =3D { + .pdu =3D get_input_881, + .pdu_len =3D sizeof(get_input_881), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x40, 0xB4 } + } +}; + +static struct get_input_test get_input_data_882 =3D { + .pdu =3D get_input_882, + .pdu_len =3D sizeof(get_input_882), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_883 =3D { + .pdu =3D get_input_883, + .pdu_len =3D sizeof(get_input_883), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_891 =3D { + .pdu =3D get_input_891, + .pdu_len =3D sizeof(get_input_891), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x80, 0xB4 } + } +}; + +static struct get_input_test get_input_data_892 =3D { + .pdu =3D get_input_892, + .pdu_len =3D sizeof(get_input_892), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_893 =3D { + .pdu =3D get_input_893, + .pdu_len =3D sizeof(get_input_893), + .qualifier =3D 0x00, + .text =3D "Enter 33333", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_8101 =3D { + .pdu =3D get_input_8101, + .pdu_len =3D sizeof(get_input_8101), + .qualifier =3D 0x00, + .text =3D "Enter 12345", + .response_length =3D { + .min =3D 5, + .max =3D 5 + }, + .text_attribute =3D { + .len =3D 4, + .attributes =3D { 0x00, 0x0B, 0x00, 0xB4 } + } +}; + +static struct get_input_test get_input_data_8102 =3D { + .pdu =3D get_input_8102, + .pdu_len =3D sizeof(get_input_8102), + .qualifier =3D 0x00, + .text =3D "Enter 22222", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_911 =3D { + .pdu =3D get_input_911, + .pdu_len =3D sizeof(get_input_911), + .qualifier =3D 0x01, + .text =3D "=E4=BD=A0=E5=A5=BD", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_921 =3D { + .pdu =3D get_input_921, + .pdu_len =3D sizeof(get_input_921), + .qualifier =3D 0x01, + .text =3D "=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD= =A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0= =E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD" + "=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5= =BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD= =E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD" + "=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5= =BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD= =E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD" + "=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5=BD=E4=BD=A0=E5=A5= =BD=E4=BD=A0=E5=A5=BD", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_1011 =3D { + .pdu =3D get_input_1011, + .pdu_len =3D sizeof(get_input_1011), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 2, + .max =3D 2 + } +}; + +static struct get_input_test get_input_data_1021 =3D { + .pdu =3D get_input_1021, + .pdu_len =3D sizeof(get_input_1021), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 5, + .max =3D 0xFF + } +}; + +static struct get_input_test get_input_data_1111 =3D { + .pdu =3D get_input_1111, + .pdu_len =3D sizeof(get_input_1111), + .qualifier =3D 0x01, + .text =3D "=E3=83=AB", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_1121 =3D { + .pdu =3D get_input_1121, + .pdu_len =3D sizeof(get_input_1121), + .qualifier =3D 0x01, + .text =3D "=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83= =AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB= =E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB" + "=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83= =AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB= =E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB" + "=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83= =AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB= =E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB" + "=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83=AB=E3=83= =AB=E3=83=AB=E3=83=AB", + .response_length =3D { + .min =3D 5, + .max =3D 5 + } +}; + +static struct get_input_test get_input_data_1211 =3D { + .pdu =3D get_input_1211, + .pdu_len =3D sizeof(get_input_1211), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 2, + .max =3D 2 + } +}; + +static struct get_input_test get_input_data_1221 =3D { + .pdu =3D get_input_1221, + .pdu_len =3D sizeof(get_input_1221), + .qualifier =3D 0x03, + .text =3D "Enter Hello", + .response_length =3D { + .min =3D 5, + .max =3D 0xFF + } }; = /* Defined in TS 102.384 Section 27.22.4.3 */ @@ -1324,18 +2588,16 @@ static void test_get_input(gconstpointer data) g_assert(command->src =3D=3D STK_DEVICE_IDENTITY_TYPE_UICC); g_assert(command->dst =3D=3D STK_DEVICE_IDENTITY_TYPE_TERMINAL); = - g_assert(command->get_input.text); - - g_assert(g_str_equal(test->expected, command->get_input.text)); - - g_assert(command->get_input.response_length.min =3D=3D test->min); - g_assert(command->get_input.response_length.max =3D=3D test->max); - - if (test->icon_id > 0) { - g_assert(command->get_input.icon_id.id =3D=3D test->icon_id); - g_assert(command->get_input.icon_id.qualifier =3D=3D - test->icon_qualifier); - } + if (test->text) + g_assert(command->get_input.text); + check_text(command->get_input.text, test->text); + check_response_length(&command->get_input.response_length, + &test->response_length); + check_text(command->get_input.default_text, test->default_text); + check_icon_id(&command->get_input.icon_id, &test->icon_id); + check_text_attr(&command->get_input.text_attribute, + &test->text_attribute); + check_frame_id(&command->get_input.frame_id, &test->frame_id); = stk_command_free(command); } @@ -1590,6 +2852,116 @@ 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 1.2.1", + &get_input_data_121, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.3.1", + &get_input_data_131, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.4.1", + &get_input_data_141, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.5.1", + &get_input_data_151, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.6.1", + &get_input_data_161, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.7.1", + &get_input_data_171, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.8.1", + &get_input_data_181, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.9.1", + &get_input_data_191, test_get_input); + g_test_add_data_func("/teststk/Get Input 1.10.1", + &get_input_data_1101, test_get_input); + g_test_add_data_func("/teststk/Get Input 2.1.1", + &get_input_data_211, test_get_input); + g_test_add_data_func("/teststk/Get Input 3.1.1", + &get_input_data_311, test_get_input); + g_test_add_data_func("/teststk/Get Input 3.2.1", + &get_input_data_321, test_get_input); + g_test_add_data_func("/teststk/Get Input 4.1.1", + &get_input_data_411, test_get_input); + g_test_add_data_func("/teststk/Get Input 4.2.1", + &get_input_data_421, test_get_input); + g_test_add_data_func("/teststk/Get Input 5.1.1", + &get_input_data_511, test_get_input); + g_test_add_data_func("/teststk/Get Input 5.2.1", + &get_input_data_521, test_get_input); + g_test_add_data_func("/teststk/Get Input 6.1.1", + &get_input_data_611, test_get_input); + g_test_add_data_func("/teststk/Get Input 6.2.1", + &get_input_data_621, test_get_input); + g_test_add_data_func("/teststk/Get Input 6.3.1", + &get_input_data_631, test_get_input); + g_test_add_data_func("/teststk/Get Input 6.4.1", + &get_input_data_641, test_get_input); + g_test_add_data_func("/teststk/Get Input 7.1.1", + &get_input_data_711, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.1.1", + &get_input_data_811, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.1.2", + &get_input_data_812, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.2.1", + &get_input_data_821, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.2.2", + &get_input_data_822, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.3.1", + &get_input_data_831, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.3.2", + &get_input_data_832, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.4.1", + &get_input_data_841, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.4.2", + &get_input_data_842, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.4.3", + &get_input_data_843, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.5.1", + &get_input_data_851, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.5.2", + &get_input_data_852, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.5.3", + &get_input_data_853, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.6.1", + &get_input_data_861, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.6.2", + &get_input_data_862, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.6.3", + &get_input_data_863, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.7.1", + &get_input_data_871, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.7.2", + &get_input_data_872, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.7.3", + &get_input_data_873, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.8.1", + &get_input_data_881, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.8.2", + &get_input_data_882, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.8.3", + &get_input_data_883, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.9.1", + &get_input_data_891, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.9.2", + &get_input_data_892, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.9.3", + &get_input_data_893, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.10.1", + &get_input_data_8101, test_get_input); + g_test_add_data_func("/teststk/Get Input 8.10.2", + &get_input_data_8102, test_get_input); + g_test_add_data_func("/teststk/Get Input 9.1.1", + &get_input_data_911, test_get_input); + g_test_add_data_func("/teststk/Get Input 9.2.1", + &get_input_data_921, test_get_input); + g_test_add_data_func("/teststk/Get Input 10.1.1", + &get_input_data_1011, test_get_input); + g_test_add_data_func("/teststk/Get Input 10.2.1", + &get_input_data_1021, test_get_input); + g_test_add_data_func("/teststk/Get Input 11.1.1", + &get_input_data_1111, test_get_input); + g_test_add_data_func("/teststk/Get Input 11.2.1", + &get_input_data_1121, test_get_input); + g_test_add_data_func("/teststk/Get Input 12.1.1", + &get_input_data_1211, test_get_input); + g_test_add_data_func("/teststk/Get Input 12.2.1", + &get_input_data_1221, test_get_input); = g_test_add_data_func("/teststk/More Time 1.1.1", &more_time_data_111, test_more_time); -- = 1.7.0.4 --===============7339091034948270431==--