4b320aec098328c8d35e98693c7c71c6e9c22f8c
[modest] / tests / dbus_api / test_open_default_inbox.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3
4 int
5 main (int argc, char *argv[])
6 {
7         osso_context_t *osso_context;
8         const char *url;
9         gboolean ret; 
10
11         osso_context = osso_initialize ("test_open_default_inbox",
12                                         "0.0.1",
13                                         TRUE,
14                                         NULL);
15                
16         if (osso_context == NULL) {
17                 g_printerr ("osso_initialize() failed.\n");
18             return -1;
19         }
20         
21         if (argc == 2) {
22                 url = argv[1];
23         } else {
24                 url = "local://???FIXME???";
25         }
26
27         g_print ("Trying to open the default inbox:\n", url);
28         ret = libmodest_dbus_client_open_default_inbox (osso_context);
29
30         if (!ret) {
31                 g_printerr ("libmodest_dbus_client_open_default_inbox() failed.\n");
32         } else {
33                 g_print ("libmodest_dbus_client_open_default_inbox() succeeded.\n");
34         }
35                 
36     return ret ? 0 : -1;
37
38 }