From 5599a5ef24c787a65de48a1449bef493d54eddc3 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Fri, 23 Oct 2009 16:59:02 +0200 Subject: [PATCH] Added test for OpenEditAccountsDialog Dbus method --- tests/dbus_api/Makefile.am | 6 ++++- tests/dbus_api/test_open_default_inbox.c | 15 +++--------- tests/dbus_api/test_open_edit_accounts_dialog.c | 29 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 tests/dbus_api/test_open_edit_accounts_dialog.c diff --git a/tests/dbus_api/Makefile.am b/tests/dbus_api/Makefile.am index 4f57bb8..061ac5c 100644 --- a/tests/dbus_api/Makefile.am +++ b/tests/dbus_api/Makefile.am @@ -31,7 +31,8 @@ noinst_PROGRAMS = \ test_get_folders \ test_top_application \ test_update_account \ - test_open_account + test_open_account \ + test_open_edit_accounts_dialog test_mail_to_SOURCES = test_mail_to.c test_mail_to_LDADD = $(objects) @@ -62,3 +63,6 @@ test_update_account_LDADD = $(objects) test_open_account_SOURCES = test_open_account.c test_open_account_LDADD = $(objects) + +test_open_edit_accounts_dialog_SOURCES = test_open_edit_accounts_dialog.c +test_open_edit_accounts_dialog_LDADD = $(objects) diff --git a/tests/dbus_api/test_open_default_inbox.c b/tests/dbus_api/test_open_default_inbox.c index 4b320ae..3cd8e95 100644 --- a/tests/dbus_api/test_open_default_inbox.c +++ b/tests/dbus_api/test_open_default_inbox.c @@ -5,26 +5,18 @@ int main (int argc, char *argv[]) { osso_context_t *osso_context; - const char *url; - gboolean ret; + gboolean ret; osso_context = osso_initialize ("test_open_default_inbox", "0.0.1", TRUE, NULL); - + if (osso_context == NULL) { g_printerr ("osso_initialize() failed.\n"); return -1; } - - if (argc == 2) { - url = argv[1]; - } else { - url = "local://???FIXME???"; - } - g_print ("Trying to open the default inbox:\n", url); ret = libmodest_dbus_client_open_default_inbox (osso_context); if (!ret) { @@ -32,7 +24,6 @@ main (int argc, char *argv[]) } else { g_print ("libmodest_dbus_client_open_default_inbox() succeeded.\n"); } - - return ret ? 0 : -1; + return ret ? 0 : -1; } diff --git a/tests/dbus_api/test_open_edit_accounts_dialog.c b/tests/dbus_api/test_open_edit_accounts_dialog.c new file mode 100644 index 0000000..9d50e8f --- /dev/null +++ b/tests/dbus_api/test_open_edit_accounts_dialog.c @@ -0,0 +1,29 @@ +#include +#include + +int +main (int argc, char *argv[]) +{ + osso_context_t *osso_context; + gboolean ret; + + osso_context = osso_initialize ("test_open_default_inbox", + "0.0.1", + TRUE, + NULL); + + if (osso_context == NULL) { + g_printerr ("osso_initialize() failed.\n"); + return -1; + } + + ret = libmodest_dbus_client_open_edit_accounts_dialog (osso_context); + + if (!ret) { + g_printerr ("libmodest_dbus_client_open_default_inbox() failed.\n"); + } else { + g_print ("libmodest_dbus_client_open_default_inbox() succeeded.\n"); + } + + return ret ? 0 : -1; +} -- 1.7.9.5