From 56bc8a2cdb4cfd5acbc3f1a9abc2d7f00c73e7e9 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 9 Mar 2009 16:51:13 +0000 Subject: [PATCH] Added a new test for the OpenAccount DBus message pmo-trunk-r7903 --- tests/dbus_api/test_open_account.c | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/dbus_api/test_open_account.c 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; +} -- 1.7.9.5