From: Sergio Villar Senin Date: Mon, 9 Mar 2009 16:51:13 +0000 (+0000) Subject: Added a new test for the OpenAccount DBus message X-Git-Tag: git_migration_finished~367 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=56bc8a2cdb4cfd5acbc3f1a9abc2d7f00c73e7e9 Added a new test for the OpenAccount DBus message pmo-trunk-r7903 --- diff --git a/tests/dbus_api/test_open_account.c b/tests/dbus_api/test_open_account.c new file mode 100644 index 0000000..016019c --- /dev/null +++ b/tests/dbus_api/test_open_account.c @@ -0,0 +1,38 @@ +#include +#include + +int +main (int argc, char *argv[]) +{ + osso_context_t *osso_context; + const char *url = NULL; + gboolean ret; + + osso_context = osso_initialize ("test_open_account", + "0.0.1", + TRUE, + NULL); + + if (osso_context == NULL) { + g_printerr ("osso_initialize() failed.\n"); + return -1; + } + + if (argc == 2) { + url = argv[1]; + } else { + g_printerr ("No account ID argument supplied on the command line.\n"); + return -1; + } + + g_print ("Trying to open msg: %s\n", url); + ret = libmodest_dbus_client_open_account (osso_context, url); + + if (!ret) { + g_printerr ("libmodest_dbus_client_open_account () failed.\n"); + } else { + g_print ("libmodest_dbus_client_open_account () succeeded.\n"); + } + + return ret ? 0 : -1; +}