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