summaryrefslogtreecommitdiff
path: root/test/testapp-account.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/testapp-account.c')
-rw-r--r--test/testapp-account.c684
1 files changed, 343 insertions, 341 deletions
diff --git a/test/testapp-account.c b/test/testapp-account.c
index 7faa9de..384361f 100644
--- a/test/testapp-account.c
+++ b/test/testapp-account.c
@@ -1,23 +1,23 @@
/*
-* email-service
-*
-* Copyright(c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* Licensed under the Apache License, Version 2.0(the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * email-service
+ *
+ * Copyright(c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0(the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
/* common header */
#include <stdio.h>
@@ -42,8 +42,8 @@
/* internal defines */
-#define GWB_RECV_SERVER_ADDR "pop.gawab.com"
-#define GWB_SMTP_SERVER_ADDR "smtp.gawab.com"
+#define GWB_RECV_SERVER_ADDR "pop.gawab.com"
+#define GWB_SMTP_SERVER_ADDR "smtp.gawab.com"
#define VDF_RECV_SERVER_ADDR "imap.email.vodafone.de"
#define VDF_SMTP_SERVER_ADDR "smtp.email.vodafone.de"
@@ -89,46 +89,46 @@ gboolean testapp_create_account_object(email_account_t **result_account)
testapp_print("Invalid input. ");
switch (account_type) {
- case 4:
- case 5:
- do {
- testapp_print("Enter your account index [1~10] : ");
- if (0 >= scanf("%d", &samsung3g_account_index))
- testapp_print("Invalid input. ");
- } while (samsung3g_account_index > 10 || samsung3g_account_index < 1);
- sprintf(id_string, "test%02d", samsung3g_account_index);
- sprintf(address_string, "test%02d@streaming.s3glab.net", samsung3g_account_index);
- sprintf(password_string, "test%02d", samsung3g_account_index);
- break;
- case 14:
- testapp_print("Enter email address : ");
- if (0 >= scanf("%s", address_string))
- testapp_print("Invalid input. ");
- strcpy(id_string, address_string);
-
- testapp_print("Enter access token : ");
- if (0 >= scanf("%s", accesss_token))
- testapp_print("Invalid input. ");
-
- testapp_print("Enter refresh token : ");
- if (0 >= scanf("%s", refresh_token))
- testapp_print("Invalid input. ");
-
- snprintf(password_string, 100, "%s\001%s\001", accesss_token, refresh_token);
- break;
- default:
- testapp_print("Enter email address : ");
- if (0 >= scanf("%s", address_string))
- testapp_print("Invalid input. ");
-
- testapp_print("Enter id : ");
- if (0 >= scanf("%s", id_string))
+ case 4:
+ case 5:
+ do {
+ testapp_print("Enter your account index [1~10] : ");
+ if (0 >= scanf("%d", &samsung3g_account_index))
testapp_print("Invalid input. ");
-
- testapp_print("Enter password_string : ");
- if (0 >= scanf("%s", password_string))
- testapp_print("Invalid input. ");
- break;
+ } while (samsung3g_account_index > 10 || samsung3g_account_index < 1);
+ sprintf(id_string, "test%02d", samsung3g_account_index);
+ sprintf(address_string, "test%02d@streaming.s3glab.net", samsung3g_account_index);
+ sprintf(password_string, "test%02d", samsung3g_account_index);
+ break;
+ case 14:
+ testapp_print("Enter email address : ");
+ if (0 >= scanf("%s", address_string))
+ testapp_print("Invalid input. ");
+ strcpy(id_string, address_string);
+
+ testapp_print("Enter access token : ");
+ if (0 >= scanf("%s", accesss_token))
+ testapp_print("Invalid input. ");
+
+ testapp_print("Enter refresh token : ");
+ if (0 >= scanf("%s", refresh_token))
+ testapp_print("Invalid input. ");
+
+ snprintf(password_string, 100, "%s\001%s\001", accesss_token, refresh_token);
+ break;
+ default:
+ testapp_print("Enter email address : ");
+ if (0 >= scanf("%s", address_string))
+ testapp_print("Invalid input. ");
+
+ testapp_print("Enter id : ");
+ if (0 >= scanf("%s", id_string))
+ testapp_print("Invalid input. ");
+
+ testapp_print("Enter password_string : ");
+ if (0 >= scanf("%s", password_string))
+ testapp_print("Invalid input. ");
+ break;
}
account = malloc(sizeof(email_account_t));
@@ -193,178 +193,179 @@ gboolean testapp_create_account_object(email_account_t **result_account)
account->outgoing_server_password = strdup(password_string);
switch (account_type) {
- case 1:/* gawab */
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3 ;
- account->incoming_server_address = strdup(GWB_RECV_SERVER_ADDR);
- account->incoming_server_port_number = EMAIL_POP3S_PORT;
- account->outgoing_server_address = strdup(GWB_SMTP_SERVER_ADDR);
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- account->outgoing_server_port_number = EMAIL_SMTPS_PORT;
- account->outgoing_server_secure_connection = 1;
-
- break;
-
- case 2:/* vadofone */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup(VDF_RECV_SERVER_ADDR);
- account->incoming_server_port_number = EMAIL_IMAP_PORT;
- account->outgoing_server_address = strdup(VDF_SMTP_SERVER_ADDR);
- account->incoming_server_secure_connection = 0;
- account->outgoing_server_need_authentication = 0;
- break;
-
- case 4:/* SAMSUNG 3G TEST */
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
- account->incoming_server_address = strdup(S3G_RECV_SERVER_ADDR);
- account->incoming_server_port_number = S3G_RECV_SERVER_PORT;
- account->outgoing_server_address = strdup(S3G_SMTP_SERVER_ADDR);
- account->outgoing_server_port_number = S3G_SMTP_SERVER_PORT;
- account->incoming_server_secure_connection = S3G_RECV_USE_SECURITY;
- account->outgoing_server_secure_connection = S3G_SMTP_USE_SECURITY;
- account->outgoing_server_need_authentication = S3G_SMTP_AUTH;
- break;
-
- case 5:/* SAMSUNG 3G TEST */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup(S3G_RECV_SERVER_ADDR);
- account->incoming_server_port_number = EMAIL_IMAPS_PORT;
- account->outgoing_server_address = strdup(S3G_SMTP_SERVER_ADDR);
- account->outgoing_server_port_number = S3G_SMTP_SERVER_PORT;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_secure_connection = S3G_SMTP_USE_SECURITY;
- account->outgoing_server_need_authentication = S3G_SMTP_AUTH;
- break;
-
- case 6:/* Gmail POP3 */
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
- account->incoming_server_address = strdup("pop.gmail.com");
- account->incoming_server_port_number = 995;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.gmail.com");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 7: /* Gmail IMAP4 */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("imap.gmail.com");
- account->incoming_server_port_number = 993;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.gmail.com");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
- account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_NO_AUTH;
- break;
-
- case 8: /* Active Sync */
- account->incoming_server_type = EMAIL_SERVER_TYPE_ACTIVE_SYNC;
- account->incoming_server_address = strdup("");
- account->incoming_server_port_number = 0;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("");
- account->outgoing_server_port_number = 0;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 9: /* AOL */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("imap.aol.com");
- account->incoming_server_port_number = 143;
- account->incoming_server_secure_connection = 0;
- account->outgoing_server_address = strdup("smtp.aol.com");
- account->outgoing_server_port_number = 587;
- account->outgoing_server_secure_connection = 0;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 10: /* Hotmail */
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
- account->incoming_server_address = strdup("pop3.live.com");
- account->incoming_server_port_number = 995;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.live.com");
- account->outgoing_server_port_number = 587;
- account->outgoing_server_secure_connection = 0x02;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 11:/* Daum IMAP4*/
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("imap.daum.net");
- account->incoming_server_port_number = 993;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.daum.net");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 12:/* Daum POP3*/
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
- account->incoming_server_address = strdup("pop.daum.net");
- account->incoming_server_port_number = 995;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.daum.net");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 13: /* Yahoo IMAP ID */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("samsung.imap.mail.yahoo.com");
- account->incoming_server_port_number = 993;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("samsung.smtp.mail.yahoo.com");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = 1;
- break;
-
- case 14: /* XOAUTH */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("imap.gmail.com");
- account->incoming_server_port_number = 993;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.gmail.com");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_XOAUTH2;
- account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_XOAUTH2;
- break;
-
- case 15: /* yandex */
- account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
- account->incoming_server_address = strdup("imap.yandex.ru");
- account->incoming_server_port_number = 993;
- account->incoming_server_secure_connection = 1;
- account->outgoing_server_address = strdup("smtp.yandex.ru");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 1;
- account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
- account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
- break;
-
- case 16: /* mopera */
- account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
- account->incoming_server_address = strdup("mail.mopera.net");
- account->incoming_server_port_number = 110;
- account->incoming_server_secure_connection = 0;
- account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_NO_AUTH;
- account->outgoing_server_address = strdup("mail.mopera.net");
- account->outgoing_server_port_number = 465;
- account->outgoing_server_secure_connection = 0;
- account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
- break;
-
- default:
- testapp_print("Invalid Account Number\n");
- return FALSE;
- break;
+ case 1:/* gawab */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3 ;
+ account->incoming_server_address = strdup(GWB_RECV_SERVER_ADDR);
+ account->incoming_server_port_number = EMAIL_POP3S_PORT;
+ account->outgoing_server_address = strdup(GWB_SMTP_SERVER_ADDR);
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ account->outgoing_server_port_number = EMAIL_SMTPS_PORT;
+ account->outgoing_server_secure_connection = 1;
+
+ break;
+
+ case 2:/* vadofone */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup(VDF_RECV_SERVER_ADDR);
+ account->incoming_server_port_number = EMAIL_IMAP_PORT;
+ account->outgoing_server_address = strdup(VDF_SMTP_SERVER_ADDR);
+ account->incoming_server_secure_connection = 0;
+ account->outgoing_server_need_authentication = 0;
+ break;
+
+ case 4:/* SAMSUNG 3G TEST */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ account->incoming_server_address = strdup(S3G_RECV_SERVER_ADDR);
+ account->incoming_server_port_number = S3G_RECV_SERVER_PORT;
+ account->outgoing_server_address = strdup(S3G_SMTP_SERVER_ADDR);
+ account->outgoing_server_port_number = S3G_SMTP_SERVER_PORT;
+ account->incoming_server_secure_connection = S3G_RECV_USE_SECURITY;
+ account->outgoing_server_secure_connection = S3G_SMTP_USE_SECURITY;
+ account->outgoing_server_need_authentication = S3G_SMTP_AUTH;
+ break;
+
+ case 5:/* SAMSUNG 3G TEST */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup(S3G_RECV_SERVER_ADDR);
+ account->incoming_server_port_number = EMAIL_IMAPS_PORT;
+ account->outgoing_server_address = strdup(S3G_SMTP_SERVER_ADDR);
+ account->outgoing_server_port_number = S3G_SMTP_SERVER_PORT;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_secure_connection = S3G_SMTP_USE_SECURITY;
+ account->outgoing_server_need_authentication = S3G_SMTP_AUTH;
+ break;
+
+ case 6:/* Gmail POP3 */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ account->incoming_server_address = strdup("pop.gmail.com");
+ account->incoming_server_port_number = 995;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.gmail.com");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 7: /* Gmail IMAP4 */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("imap.gmail.com");
+ account->incoming_server_port_number = 993;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.gmail.com");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
+ account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_NO_AUTH;
+ break;
+
+ case 8: /* Active Sync */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_ACTIVE_SYNC;
+ account->incoming_server_address = strdup("");
+ account->incoming_server_port_number = 0;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("");
+ account->outgoing_server_port_number = 0;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 9: /* AOL */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("imap.aol.com");
+ account->incoming_server_port_number = 143;
+ account->incoming_server_secure_connection = 0;
+ account->outgoing_server_address = strdup("smtp.aol.com");
+ account->outgoing_server_port_number = 587;
+ account->outgoing_server_secure_connection = 0;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 10: /* Hotmail */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ account->incoming_server_address = strdup("pop3.live.com");
+ account->incoming_server_port_number = 995;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.live.com");
+ account->outgoing_server_port_number = 587;
+ account->outgoing_server_secure_connection = 0x02;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 11:/* Daum IMAP4*/
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("imap.daum.net");
+ account->incoming_server_port_number = 993;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.daum.net");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 12:/* Daum POP3*/
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ account->incoming_server_address = strdup("pop.daum.net");
+ account->incoming_server_port_number = 995;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.daum.net");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 13: /* Yahoo IMAP ID */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("samsung.imap.mail.yahoo.com");
+ account->incoming_server_port_number = 993;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("samsung.smtp.mail.yahoo.com");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = 1;
+ break;
+
+ case 14: /* XOAUTH */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("imap.gmail.com");
+ account->incoming_server_port_number = 993;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.gmail.com");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_XOAUTH2;
+ account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_XOAUTH2;
+ break;
+
+ case 15: /* yandex */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_IMAP4;
+ account->incoming_server_address = strdup("imap.yandex.ru");
+ account->incoming_server_port_number = 993;
+ account->incoming_server_secure_connection = 1;
+ account->outgoing_server_address = strdup("smtp.yandex.ru");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 1;
+ account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
+ account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
+ break;
+
+ case 16: /* mopera */
+ account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+ account->incoming_server_address = strdup("mail.mopera.net");
+ account->incoming_server_port_number = 110;
+ account->incoming_server_secure_connection = 0;
+ account->incoming_server_authentication_method = EMAIL_AUTHENTICATION_METHOD_NO_AUTH;
+ account->outgoing_server_address = strdup("mail.mopera.net");
+ account->outgoing_server_port_number = 465;
+ account->outgoing_server_secure_connection = 0;
+ account->outgoing_server_need_authentication = EMAIL_AUTHENTICATION_METHOD_DEFAULT;
+ break;
+
+ default:
+ testapp_print("Invalid Account Number\n");
+ email_free_account(&account, 1);
+ return FALSE;
+ break;
}
account->account_svc_id = 77;
@@ -389,7 +390,7 @@ static gboolean testapp_test_add_account_with_validation()
return FALSE;
}
- email_get_account_list (&account_list, &pre_count);
+ email_get_account_list(&account_list, &pre_count);
err = email_add_account_with_validation(account, &handle);
if (err < 0) {
@@ -401,7 +402,7 @@ static gboolean testapp_test_add_account_with_validation()
err = email_free_account(&account, 1);
do {
- email_get_account_list (&account_list, &count);
+ email_get_account_list(&account_list, &count);
if (count > pre_count) {
flag = true;
@@ -432,7 +433,8 @@ static gboolean testapp_test_update_account()
//char signature[100] = {0};
//char user_email_address[256] = {0,};
//int add_my_address_to_bcc = 0;
- int with_validation = 0; //account_svc_id = 0,
+ //int with_validation = 0;
+ //int account_svc_id = 0,
testapp_print("\n>> Enter Account ID: ");
if (0 >= scanf("%d", &account_id))
@@ -451,48 +453,48 @@ static gboolean testapp_test_update_account()
testapp_print("\n Enter new check interval(in mins):");
if (0 >= scanf("%d", &(account->check_interval)))
testapp_print("Invalid input. ");
-/*
- testapp_print("\n Enter new peak interval(in mins):");
- if (0 >= scanf("%d", &(account->peak_interval));
+ /*
+ testapp_print("\n Enter new peak interval(in mins):");
+ if (0 >= scanf("%d", &(account->peak_interval));
- testapp_print("\n Enter new peak days:");
- if (0 >= scanf("%d", &(account->peak_days));
+ testapp_print("\n Enter new peak days:");
+ if (0 >= scanf("%d", &(account->peak_days));
- testapp_print("\n Enter new peak start time:");
- if (0 >= scanf("%d", &(account->peak_start_time));
+ testapp_print("\n Enter new peak start time:");
+ if (0 >= scanf("%d", &(account->peak_start_time));
- testapp_print("\n Enter new peak end time:");
- if (0 >= scanf("%d", &(account->peak_end_time));
-*/
+ testapp_print("\n Enter new peak end time:");
+ if (0 >= scanf("%d", &(account->peak_end_time));
+ */
-/*
- testapp_print("\n Enter new Account name:");
- if (0 >= scanf("%s",account_name);
+ /*
+ testapp_print("\n Enter new Account name:");
+ if (0 >= scanf("%s",account_name);
- testapp_print("\n Enter new email addr:");
- if (0 >= scanf("%s",user_email_address);
+ testapp_print("\n Enter new email addr:");
+ if (0 >= scanf("%s",user_email_address);
- testapp_print("\n Enter new signature:");
- if (0 >= scanf("%s",signature);
+ testapp_print("\n Enter new signature:");
+ if (0 >= scanf("%s",signature);
- testapp_print("\n>> Enter add_my_address_to_bcc:(0:off, 1:on) ");
- if (0 >= scanf("%d", &add_my_address_to_bcc);
+ testapp_print("\n>> Enter add_my_address_to_bcc:(0:off, 1:on) ");
+ if (0 >= scanf("%d", &add_my_address_to_bcc);
- testapp_print("\n>> Enter account_svc_id: ");
- if (0 >= scanf("%d", &account_svc_id);
+ testapp_print("\n>> Enter account_svc_id: ");
+ if (0 >= scanf("%d", &account_svc_id);
- testapp_print("\n>> With validation ?(0: No, 1:Yes) ");
- if (0 >= scanf("%d", &with_validation);
-*/
+ testapp_print("\n>> With validation ?(0: No, 1:Yes) ");
+ if (0 >= scanf("%d", &with_validation);
+ */
testapp_print("\n Assigning New Account name:(%s)", account->account_name);
testapp_print("\n Assigning New Signature:(%s)\n", account->options.signature);
- /*
- account->account_name = strdup(account_name);
- account->user_email_address = strdup(user_email_address);
- account->options.signature = strdup(signature);
- account->options.add_my_address_to_bcc = add_my_address_to_bcc;
- account->account_svc_id = account_svc_id;
- */
+ /*
+ account->account_name = strdup(account_name);
+ account->user_email_address = strdup(user_email_address);
+ account->options.signature = strdup(signature);
+ account->options.add_my_address_to_bcc = add_my_address_to_bcc;
+ account->account_svc_id = account_svc_id;
+ */
if ((err = email_update_account(account_id, account)) != EMAIL_ERROR_NONE) {
testapp_print("email_update_account failed - %d\n", err);
@@ -512,7 +514,7 @@ static gboolean testapp_test_delete_account()
if (0 >= scanf("%d", &account_id))
testapp_print("Invalid input. ");
-/* sowmya.kr, 281209 Adding signature to options in email_account_t changes */
+ /* sowmya.kr, 281209 Adding signature to options in email_account_t changes */
if ((err = email_get_account(account_id, WITHOUT_OPTION, &account)) < 0) {
testapp_print("email_get_account failed \n");
testapp_print("testapp_test_delete_account failed\n");
@@ -629,7 +631,7 @@ static gboolean testapp_test_get_account()
"display_content_status %d\n"
"default_ringtone_status %d\n"
"alert_ringtone_path %s\n"
- ,
+ ,
account->account_name,
account->user_email_address,
account->incoming_server_secure_connection,
@@ -658,7 +660,7 @@ static gboolean testapp_test_get_account()
account->options.display_content_status,
account->options.default_ringtone_status,
account->options.alert_ringtone_path
- );
+ );
err_code = email_free_account(&account, 1);
@@ -675,11 +677,11 @@ static gboolean testapp_test_get_account()
"user_email_address - %s \n"
"incoming_server_secure_connection %d \n"
"add_signature : %d \n",
- account->account_name,
- account->user_email_address,
- account->incoming_server_secure_connection,
- account->options.add_signature
- );
+ account->account_name,
+ account->user_email_address,
+ account->incoming_server_secure_connection,
+ account->options.add_signature
+ );
if (account->options.signature)
testapp_print("signature : %s\n", account->options.signature);
@@ -701,11 +703,11 @@ static gboolean testapp_test_get_account()
"signature %s \n"
"add_my_address_to_bcc %d\n"
"account_svc_id %d\n",
- account->options.add_signature,
- account->options.signature,
- account->options.add_my_address_to_bcc,
- account->account_svc_id
- );
+ account->options.add_signature,
+ account->options.signature,
+ account->options.add_my_address_to_bcc,
+ account->account_svc_id
+ );
if (account->account_name)
testapp_print("account_name : %s \n", account->account_name);
@@ -743,8 +745,8 @@ static gboolean testapp_test_get_account_list()
for (i = 0; i < count; i++) {
testapp_print(" %2d) %-15s %-30s\n", account_list[i].account_id,
- account_list[i].account_name,
- account_list[i].user_email_address);
+ account_list[i].account_name,
+ account_list[i].user_email_address);
}
err_code = email_free_account(&account_list, count);
@@ -794,7 +796,7 @@ static gboolean testapp_test_backup_account()
}
static gboolean testapp_test_restore_account()
{
- const char *file_name = tzplatform_mkpath(TZ_USER_DATA,"email/accounts_file");
+ const char *file_name = tzplatform_mkpath(TZ_USER_DATA, "email/accounts_file");
int error_code;
error_code = email_restore_accounts_from_secure_storage(file_name);
testapp_print("\n email_restore_accounts_from_secure_storage returned [%d]\n", error_code);
@@ -976,84 +978,84 @@ static gboolean testapp_test_interpret_command(int selected_number)
gboolean go_to_loop = TRUE;
switch (selected_number) {
- case 1:
- testapp_test_add_account_with_validation();
- break;
+ case 1:
+ testapp_test_add_account_with_validation();
+ break;
- case 2:
- testapp_test_update_account();
- break;
+ case 2:
+ testapp_test_update_account();
+ break;
- case 3:
- testapp_test_delete_account();
- break;
+ case 3:
+ testapp_test_delete_account();
+ break;
- case 4:
- testapp_test_get_account();
- break;
+ case 4:
+ testapp_test_get_account();
+ break;
- case 5:
- testapp_test_get_account_list();
- break;
+ case 5:
+ testapp_test_get_account_list();
+ break;
- case 6:
- testapp_test_update_check_interval();
- break;
+ case 6:
+ testapp_test_update_check_interval();
+ break;
- case 7:
- testapp_test_validate_account();
- break;
+ case 7:
+ testapp_test_validate_account();
+ break;
- case 8:
- testapp_test_cancel_validate_account();
- break;
+ case 8:
+ testapp_test_cancel_validate_account();
+ break;
- case 9:
- testapp_test_backup_account();
- break;
+ case 9:
+ testapp_test_backup_account();
+ break;
- case 10:
- testapp_test_restore_account();
- break;
+ case 10:
+ testapp_test_restore_account();
+ break;
- case 11:
- testapp_test_get_password_length_of_account();
- break;
+ case 11:
+ testapp_test_get_password_length_of_account();
+ break;
- case 13:
- testapp_test_update_notification();
- break;
+ case 13:
+ testapp_test_update_notification();
+ break;
- case 14:
- testapp_test_clear_notification();
- break;
+ case 14:
+ testapp_test_clear_notification();
+ break;
- case 15:
- testapp_test_clear_all_notification();
- break;
+ case 15:
+ testapp_test_clear_all_notification();
+ break;
- case 16:
- testapp_test_save_default_account_id();
- break;
+ case 16:
+ testapp_test_save_default_account_id();
+ break;
- case 17:
- testapp_test_load_default_account_id();
- break;
+ case 17:
+ testapp_test_load_default_account_id();
+ break;
- case 18:
- testapp_test_add_account();
- break;
+ case 18:
+ testapp_test_add_account();
+ break;
- case 19:
- testapp_test_update_peak_schedule();
- break;
+ case 19:
+ testapp_test_update_peak_schedule();
+ break;
- case 0:
- go_to_loop = FALSE;
- break;
+ case 0:
+ go_to_loop = FALSE;
+ break;
- default:
- break;
+ default:
+ break;
}
return go_to_loop;