summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-10-18 20:42:52 -0500
committerDenis Kenzior <denkenz@gmail.com>2012-10-18 20:42:52 -0500
commitc91de33b2ab246ccf2a82aa0f9bdeffde85fa55f (patch)
tree218cb369eaea7d08bad3959d4800e559ae2942a5 /tools
parent124e2bbc09da75bac047a95629b0ba290636fcbd (diff)
downloadofono-c91de33b2ab246ccf2a82aa0f9bdeffde85fa55f.tar.bz2
stktest: Add GetInput test sequence 5.1-5.2
Diffstat (limited to 'tools')
-rw-r--r--tools/stktest.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/tools/stktest.c b/tools/stktest.c
index 44e13450..e1abae15 100644
--- a/tools/stktest.c
+++ b/tools/stktest.c
@@ -2527,6 +2527,56 @@ static DBusMessage *test_get_input_42(DBusMessage *msg,
return reply;
}
+static DBusMessage *test_get_input_51(DBusMessage *msg,
+ const char *alpha,
+ unsigned char icon_id,
+ const char *def_input,
+ unsigned char min, unsigned char max,
+ gboolean hide_typing)
+{
+ DBusMessage *reply;
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter 12345"));
+ STKTEST_AGENT_ASSERT(icon_id == 0);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, "12345"));
+ STKTEST_AGENT_ASSERT(min == 5);
+ STKTEST_AGENT_ASSERT(max == 5);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &def_input,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
+static DBusMessage *test_get_input_52(DBusMessage *msg,
+ const char *alpha,
+ unsigned char icon_id,
+ const char *def_input,
+ unsigned char min, unsigned char max,
+ gboolean hide_typing)
+{
+ DBusMessage *reply;
+ const char *def_expect =
+ "***1111111111###***2222222222###***3333333333###***4444444444###***"
+ "5555555555###***6666666666###***7777777777###***8888888888###***9999"
+ "999999###***0000000000###";
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter:"));
+ STKTEST_AGENT_ASSERT(icon_id == 0);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, def_expect));
+ STKTEST_AGENT_ASSERT(min == 160);
+ STKTEST_AGENT_ASSERT(max == 160);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &def_input,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
static void power_down_reply(DBusPendingCall *call, void *user_data)
{
__stktest_test_next();
@@ -3061,6 +3111,18 @@ static void __stktest_test_init(void)
sizeof(get_input_response_421),
test_get_input_42,
expect_response_and_finish);
+ stktest_add_test("Get Input 5.1", "RequestDigits",
+ get_input_511, sizeof(get_input_511),
+ get_input_response_511,
+ sizeof(get_input_response_511),
+ test_get_input_51,
+ expect_response_and_finish);
+ stktest_add_test("Get Input 5.2", "RequestDigits",
+ get_input_521, sizeof(get_input_521),
+ get_input_response_521,
+ sizeof(get_input_response_521),
+ test_get_input_52,
+ expect_response_and_finish);
}
static void test_destroy(gpointer user_data)