Added a new test for the OpenAccount DBus message
[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,file:///usr/include/glib-2.0/glib.h");
22         
23         const gboolean ret = libmodest_dbus_client_compose_mail (
24                 osso_context,
25                 "modesttest@modesttest.com", /* to */
26                 "cc test", /* cc */
27                 "bcc test", /* bcc */
28                 "test subject", /* subject */
29                 "test body\nline two", /* body */
30                 attachments);
31                 
32         
33         if (!ret) {
34                 printf("libmodest_dbus_client_compose_mail() failed.\n");
35                 return OSSO_ERROR;
36         } else {
37                 printf("libmodest_dbus_client_compose_mail() succeeded\n");
38         }
39                 
40     /* Exit */
41     return 0;
42 }