Added two new exceptions for the country parsing. It's a workaround to fix bad values...
[modest] / tests / dbus_api / test_update_account.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <glib.h>
5
6 static gboolean manual = FALSE;
7 static gchar *account_id = NULL;
8
9 static GOptionEntry option_entries [] =
10 {
11         { "manual", 'm', 0, G_OPTION_ARG_NONE, &manual, "Manual send receive, so behave as interactive.", NULL },
12         { "account", 'a', 0, G_OPTION_ARG_STRING, &account_id, "Account to perform send receive into", NULL },
13         { NULL }
14 };
15
16
17 int
18 main (int argc, char *argv[])
19 {
20         osso_context_t *osso_context;
21         GOptionContext *context;
22         gboolean result;
23         GError *error = NULL;
24
25         context = g_option_context_new ("- Modest email client");
26         g_option_context_add_main_entries (context, option_entries, NULL);
27         if (!g_option_context_parse (context, &argc, &argv, &error)) {
28                 g_print ("option parsing failed: %s\n", error->message);
29                 g_option_context_free (context);
30                 exit (1);
31         }
32         g_option_context_free (context);
33
34         osso_context = osso_initialize ("test_update_account",
35                                         "0.0.1",
36                                         TRUE,
37                                         NULL);
38                
39         if (osso_context == NULL) {
40                 g_printerr ("osso_initialize() failed.\n");
41             return -1;
42         }
43
44         result = libmodest_dbus_client_send_and_receive_full (osso_context, account_id, manual);
45         g_free (account_id);
46
47         return result;
48
49 }