Added test for OpenEditAccountsDialog Dbus method
[modest] / tests / dbus_api / test_compose_mail.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3
4
5 int main(int argc, char *argv[])
6 {
7         GSList *attachments = NULL;
8         /* Initialize maemo application */
9         osso_context_t * osso_context = osso_initialize(
10             "test_hello", "0.0.1", TRUE, NULL);
11                
12         /* Check that initialization was ok */
13         if (osso_context == NULL)
14         {
15                 printf("osso_initialize() failed.\n");
16             return OSSO_ERROR;
17         }
18         
19         /* Call the function in libmodest-dbus-client: */
20         
21         attachments = g_slist_append(attachments, "file:///usr/include/math.h");
22         attachments = g_slist_append(attachments, "file:///usr/include/glib-2.0/glib.h");
23         attachments = g_slist_append(attachments, "file:///tmp/file,coma.txt");
24         
25         const gboolean ret = libmodest_dbus_client_compose_mail (
26                 osso_context,
27                 "modesttest@modesttest.com", /* to */
28                 "cc test", /* cc */
29                 "bcc test", /* bcc */
30                 "test subject", /* subject */
31                 "test body\nline two", /* body */
32                 attachments);
33                 
34         
35         if (!ret) {
36                 printf("libmodest_dbus_client_compose_mail() failed.\n");
37                 return OSSO_ERROR;
38         } else {
39                 printf("libmodest_dbus_client_compose_mail() succeeded\n");
40         }
41                 
42     /* Exit */
43     return 0;
44 }