mirror of git://git.sysmocom.de/ofono
stktest: Add GetInkey test sequence 10.1-10.2
This commit is contained in:
parent
3f7736c967
commit
039047a9ba
|
@ -1982,6 +1982,46 @@ static DBusMessage *test_get_inkey_910(DBusMessage *msg,
|
|||
return reply;
|
||||
}
|
||||
|
||||
static DBusMessage *test_get_inkey_101(DBusMessage *msg,
|
||||
const char *alpha,
|
||||
unsigned char icon_id)
|
||||
{
|
||||
DBusMessage *reply;
|
||||
const char *ret = "+";
|
||||
const char *expect = "你好";
|
||||
|
||||
STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
|
||||
STKTEST_AGENT_ASSERT(icon_id == 0);
|
||||
|
||||
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_inkey_102(DBusMessage *msg,
|
||||
const char *alpha,
|
||||
unsigned char icon_id)
|
||||
{
|
||||
DBusMessage *reply;
|
||||
const char *ret = "+";
|
||||
const char *expect =
|
||||
"你好你好你好你好你好你好你好你好你好你好"
|
||||
"你好你好你好你好你好你好你好你好你好你好"
|
||||
"你好你好你好你好你好你好你好你好你好你好"
|
||||
"你好你好你好你好你好";
|
||||
|
||||
STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
|
||||
STKTEST_AGENT_ASSERT(icon_id == 0);
|
||||
|
||||
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();
|
||||
|
@ -2390,6 +2430,18 @@ static void __stktest_test_init(void)
|
|||
sizeof(get_inkey_response_9101),
|
||||
test_get_inkey_910,
|
||||
expect_response_and_finish);
|
||||
stktest_add_test("Get Inkey 10.1", "RequestDigit",
|
||||
get_inkey_1011, sizeof(get_inkey_1011),
|
||||
get_inkey_response_1011,
|
||||
sizeof(get_inkey_response_1011),
|
||||
test_get_inkey_101,
|
||||
expect_response_and_finish);
|
||||
stktest_add_test("Get Inkey 10.2", "RequestDigit",
|
||||
get_inkey_1021, sizeof(get_inkey_1021),
|
||||
get_inkey_response_1021,
|
||||
sizeof(get_inkey_response_1021),
|
||||
test_get_inkey_102,
|
||||
expect_response_and_finish);
|
||||
}
|
||||
|
||||
static void test_destroy(gpointer user_data)
|
||||
|
|
Loading…
Reference in New Issue