Added test for OpenEditAccountsDialog Dbus method
authorSergio Villar Senin <svillar@igalia.com>
Fri, 23 Oct 2009 14:59:02 +0000 (16:59 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 2 Nov 2009 09:32:41 +0000 (10:32 +0100)
tests/dbus_api/Makefile.am
tests/dbus_api/test_open_default_inbox.c
tests/dbus_api/test_open_edit_accounts_dialog.c [new file with mode: 0644]

index 4f57bb8..061ac5c 100644 (file)
@@ -31,7 +31,8 @@ noinst_PROGRAMS = \
        test_get_folders \
        test_top_application \
        test_update_account \
        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)
 
 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_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)
index 4b320ae..3cd8e95 100644 (file)
@@ -5,26 +5,18 @@ int
 main (int argc, char *argv[])
 {
        osso_context_t *osso_context;
 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);
 
        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 (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) {
        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");
        }
        } 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 (file)
index 0000000..9d50e8f
--- /dev/null
@@ -0,0 +1,29 @@
+#include <libmodest-dbus-client/libmodest-dbus-client.h>
+#include <stdio.h>
+
+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;
+}