From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 5/7] test-stkutil: Add unit test for more time parser
Date: Tue, 27 Apr 2010 17:47:10 +0800 [thread overview]
Message-ID: <1272361632-21352-5-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1272361632-21352-1-git-send-email-yang.gu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]
---
unit/test-stkutil.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 0961368..427d7a2 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -405,6 +405,41 @@ static void test_get_input(gconstpointer data)
stk_command_free(command);
}
+struct more_time_test {
+ const unsigned char *pdu;
+ unsigned int pdu_len;
+ unsigned char qualifier;
+};
+
+static unsigned char more_time_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x02,
+ 0x00, 0x82, 0x02, 0x81, 0x82 };
+
+static struct more_time_test more_time_data_111 = {
+ .pdu = more_time_111,
+ .pdu_len = sizeof(more_time_111),
+ .qualifier = 0x00,
+};
+
+/* Defined in TS 102.384 Section 27.22.4.4 */
+static void test_more_time(gconstpointer data)
+{
+ const struct get_input_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_MORE_TIME);
+ g_assert(command->qualifier == test->qualifier);
+
+ g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+ g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+ stk_command_free(command);
+}
+
struct send_sms_test {
const unsigned char *pdu;
unsigned int pdu_len;
@@ -516,6 +551,9 @@ 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/More Time 1.1.1",
+ &more_time_data_111, test_more_time);
+
g_test_add_data_func("/teststk/Send SMS 1.1",
&send_sms_data_11, test_send_sms);
--
1.7.0.4
next prev parent reply other threads:[~2010-04-27 9:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 9:47 [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj Yang Gu
2010-04-27 9:47 ` [PATCH 2/7] stkutil: Use struct to represent frame id Yang Gu
2010-04-27 9:47 ` [PATCH 3/7] test-stkutil: Refactor the implementation to test display text Yang Gu
2010-04-27 9:47 ` [PATCH 4/7] stkutil: Add parser for more time proactive commands Yang Gu
2010-04-27 9:47 ` Yang Gu [this message]
2010-04-27 9:47 ` [PATCH 6/7] stkutil: Change some dataobj parser to use char * instead of char ** Yang Gu
2010-04-27 9:47 ` [PATCH 7/7] stkutil: Make get inkey parser use its own struct Yang Gu
2010-04-27 14:36 ` [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj 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=1272361632-21352-5-git-send-email-yang.gu@intel.com \
--to=yang.gu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox