From 67822514363e31c6e7f52a160ef7203aea75c53a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 28 Sep 2012 18:45:51 -0500 Subject: [PATCH] stktest: Fail test if DisplayText is not expected --- tools/stktest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/stktest.c b/tools/stktest.c index 64332db5..adb7d75c 100644 --- a/tools/stktest.c +++ b/tools/stktest.c @@ -231,6 +231,18 @@ static DBusMessage *agent_display_text(DBusConnection *conn, DBusMessage *msg, test = cur_test->data; func = test->agent_func; + if (strcmp(test->method, "DisplayText")) { + g_printerr("Wrong method called!\n"); + __stktest_test_finish(FALSE); + return stktest_error_failed(msg); + } + + if (func == NULL) { + g_printerr("DisplayText not expected to be called"); + __stktest_test_finish(FALSE); + return stktest_error_failed(msg); + } + return func(msg, text, icon_id, urgent); }