Fixes NB#143352, add a DBus API to request inmmediate Send&Receive (like manual send...
[modest] / tests / dbus_api / test_top_application.c
1 #include <libmodest-dbus-client/libmodest-dbus-api.h>
2 #include <libosso.h>
3 #include <stdio.h>
4
5 int
6 main (int argc, char *argv[])
7 {
8         
9         osso_context_t * osso_context = osso_initialize ("test_open_default_inbox",
10                                         "0.0.1",
11                                         TRUE,
12                                         NULL);
13                
14         if (osso_context == NULL) {
15                 g_printerr ("osso_initialize() failed.\n");
16             return -1;
17         }
18
19         osso_rpc_t retval;
20         const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, 
21                    MODEST_DBUS_NAME, 
22                    MODEST_DBUS_METHOD_TOP_APPLICATION, &retval, 
23                    DBUS_TYPE_INVALID);
24                 
25         if (ret != OSSO_OK) {
26                 printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__);
27                 return FALSE;
28         } else {
29                 printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__);
30         }
31         
32         osso_rpc_free_val(&retval);
33         
34         return TRUE;
35                 
36         return ret ? 0 : -1;
37 }