mirror of git://git.sysmocom.de/ofono
stktest: Add GetInput test sequence 6.1-6.4
This commit is contained in:
parent
eac1d829a6
commit
edf99d6fcc
120
tools/stktest.c
120
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, "<NO-ICON>"));
|
||||
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, "<BASIC-ICON>"));
|
||||
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, "<NO-ICON>"));
|
||||
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, "<COLOUR-ICON>"));
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue