summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-10-18 21:00:55 -0500
committerDenis Kenzior <denkenz@gmail.com>2012-10-18 21:00:55 -0500
commitedf99d6fcc283bbf735eb38e8363963a5c9aca96 (patch)
treee92ea63137f3f955da55ea6804296dcc3ac0c4a5 /tools
parenteac1d829a6a9932f69e206b32863f38d3054bcff (diff)
downloadofono-edf99d6fcc283bbf735eb38e8363963a5c9aca96.tar.bz2
stktest: Add GetInput test sequence 6.1-6.4
Diffstat (limited to 'tools')
-rw-r--r--tools/stktest.c120
1 files changed, 120 insertions, 0 deletions
diff --git a/tools/stktest.c b/tools/stktest.c
index e1abae15..bdb17fd9 100644
--- a/tools/stktest.c
+++ b/tools/stktest.c
@@ -2577,6 +2577,102 @@ static DBusMessage *test_get_input_52(DBusMessage *msg,
return reply;
}
+static DBusMessage *test_get_input_61(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 *ret = "+";
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+ STKTEST_AGENT_ASSERT(icon_id == 1);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+ STKTEST_AGENT_ASSERT(min == 0);
+ STKTEST_AGENT_ASSERT(max == 10);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
+static DBusMessage *test_get_input_62(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 *ret = "+";
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;BASIC-ICON&gt;"));
+ STKTEST_AGENT_ASSERT(icon_id == 1);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+ STKTEST_AGENT_ASSERT(min == 0);
+ STKTEST_AGENT_ASSERT(max == 10);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
+static DBusMessage *test_get_input_63(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 *ret = "+";
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+ STKTEST_AGENT_ASSERT(icon_id == 2);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+ STKTEST_AGENT_ASSERT(min == 0);
+ STKTEST_AGENT_ASSERT(max == 10);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
+static DBusMessage *test_get_input_64(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 *ret = "+";
+
+ STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;COLOUR-ICON&gt;"));
+ STKTEST_AGENT_ASSERT(icon_id == 2);
+ STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+ STKTEST_AGENT_ASSERT(min == 0);
+ STKTEST_AGENT_ASSERT(max == 10);
+ STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+ DBUS_TYPE_INVALID);
+
+ return reply;
+}
+
static void power_down_reply(DBusPendingCall *call, void *user_data)
{
__stktest_test_next();
@@ -3123,6 +3219,30 @@ static void __stktest_test_init(void)
sizeof(get_input_response_521),
test_get_input_52,
expect_response_and_finish);
+ stktest_add_test("Get Input 6.1", "RequestDigits",
+ get_input_611, sizeof(get_input_611),
+ get_input_response_611a,
+ sizeof(get_input_response_611a),
+ test_get_input_61,
+ expect_response_and_finish);
+ stktest_add_test("Get Input 6.2", "RequestDigits",
+ get_input_621, sizeof(get_input_621),
+ get_input_response_621a,
+ sizeof(get_input_response_621a),
+ test_get_input_62,
+ expect_response_and_finish);
+ stktest_add_test("Get Input 6.3", "RequestDigits",
+ get_input_631, sizeof(get_input_631),
+ get_input_response_631a,
+ sizeof(get_input_response_631a),
+ test_get_input_63,
+ expect_response_and_finish);
+ stktest_add_test("Get Input 6.4", "RequestDigits",
+ get_input_641, sizeof(get_input_641),
+ get_input_response_641a,
+ sizeof(get_input_response_641a),
+ test_get_input_64,
+ expect_response_and_finish);
}
static void test_destroy(gpointer user_data)