diff options
author | Denis Kenzior <denkenz@gmail.com> | 2012-10-18 13:46:07 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-10-18 13:46:07 -0500 |
commit | 9420c09b4cd5630f8fbd993fbe0a5c64ab8ee9e4 (patch) | |
tree | 26dcdbd581b0c46fe0ce9598b7797017f3e4a7bb /tools | |
parent | 03a619d7adfb0031ed39bf40d58fffa5005f4f4f (diff) | |
download | ofono-9420c09b4cd5630f8fbd993fbe0a5c64ab8ee9e4.tar.bz2 |
stktest: Add GetInput test sequence 3.1-3.2
Diffstat (limited to 'tools')
-rw-r--r-- | tools/stktest.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tools/stktest.c b/tools/stktest.c index b7890738..797be5fc 100644 --- a/tools/stktest.c +++ b/tools/stktest.c @@ -2425,6 +2425,58 @@ static DBusMessage *test_get_input_21(DBusMessage *msg, return NULL; } +static DBusMessage *test_get_input_31(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 *expect = "ЗДРАВСТВУЙТЕ"; + const char *ret = "HELLO"; + + STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect)); + STKTEST_AGENT_ASSERT(icon_id == 0); + STKTEST_AGENT_ASSERT(g_str_equal(def_input, "")); + 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, &ret, + DBUS_TYPE_INVALID); + + return reply; +} + +static DBusMessage *test_get_input_32(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 *expect = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ" + "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ" + "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ"; + const char *ret = "HELLO"; + + STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect)); + STKTEST_AGENT_ASSERT(icon_id == 0); + STKTEST_AGENT_ASSERT(g_str_equal(def_input, "")); + 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, &ret, + DBUS_TYPE_INVALID); + + return reply; +} + static void power_down_reply(DBusPendingCall *call, void *user_data) { __stktest_test_next(); @@ -2935,6 +2987,18 @@ static void __stktest_test_init(void) sizeof(get_input_response_211), test_get_input_21, expect_response_and_finish); + stktest_add_test("Get Input 3.1", "RequestInput", + get_input_311, sizeof(get_input_311), + get_input_response_311, + sizeof(get_input_response_311), + test_get_input_31, + expect_response_and_finish); + stktest_add_test("Get Input 3.2", "RequestInput", + get_input_321, sizeof(get_input_321), + get_input_response_321, + sizeof(get_input_response_321), + test_get_input_32, + expect_response_and_finish); } static void test_destroy(gpointer user_data) |