From d0347b7f4c83f99630c5027ca000194a29e568d0 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sat, 20 Oct 2012 19:50:55 -0500 Subject: [PATCH] unit: Add GetInput test sequence 9.1-9.2 --- tools/stktest.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tools/stktest.c b/tools/stktest.c index ecba552..6139d92 100644 --- a/tools/stktest.c +++ b/tools/stktest.c @@ -2747,6 +2747,38 @@ GET_INPUT_8X_TEMPLATE(10, "
Enter 12345
") +#define GET_INPUT_9X_11X_TEMPLATE(seq, expect) \ +static DBusMessage *test_get_input_##seq(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 = "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; \ +} + +GET_INPUT_9X_11X_TEMPLATE(91, "你好") +GET_INPUT_9X_11X_TEMPLATE(92, "你好你好你好你好你好你好你好你好你好你好" + "你好你好你好你好你好你好你好你好你好你好" + "你好你好你好你好你好你好你好你好你好你好" + "你好你好你好你好你好") + static void power_down_reply(DBusPendingCall *call, void *user_data) { __stktest_test_next(); @@ -3378,6 +3410,18 @@ static void __stktest_test_init(void) sizeof(get_input_response_8101), test_get_input_810, expect_response_and_finish); + stktest_add_test("Get Input 9.1", "RequestInput", + get_input_911, sizeof(get_input_911), + get_input_response_911, + sizeof(get_input_response_911), + test_get_input_91, + expect_response_and_finish); + stktest_add_test("Get Input 9.2", "RequestInput", + get_input_921, sizeof(get_input_921), + get_input_response_921, + sizeof(get_input_response_921), + test_get_input_92, + expect_response_and_finish); } static void test_destroy(gpointer user_data) -- 2.7.4