From 0d7d9bb7cbf6cd7daa55d956908b4b77730c807a Mon Sep 17 00:00:00 2001 From: "intae, jeon" Date: Thu, 24 Nov 2016 17:06:09 +0900 Subject: fix test_app for account setting Change-Id: I55ee5b156c67ff0799f719ea51603e0f58b1b1c2 Signed-off-by: intae, jeon --- utilities/test-application/testapp-account.c | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/utilities/test-application/testapp-account.c b/utilities/test-application/testapp-account.c index 79f634f..0dc994f 100755 --- a/utilities/test-application/testapp-account.c +++ b/utilities/test-application/testapp-account.c @@ -379,12 +379,18 @@ static gboolean testapp_test_add_account_with_validation() int err = EMAIL_ERROR_NONE; email_account_t *account = NULL; int handle; - + int flag = false; + int pre_count = 0; + int count = 0; + email_account_t *account_list = NULL; + int loop_count = 0; if (!testapp_create_account_object(&account)) { testapp_print("testapp_test_create_account_by_account_type error\n"); return FALSE; } + email_get_account_list (&account_list, &pre_count); + err = email_add_account_with_validation(account, &handle); if (err < 0) { testapp_print("email_add_account_with_validation error : %d\n", err); @@ -392,10 +398,28 @@ static gboolean testapp_test_add_account_with_validation() return FALSE; } - testapp_print("email_add_account succeed. account_id\n", account->account_id); - err = email_free_account(&account, 1); + do { + email_get_account_list (&account_list, &count); + + if (count > pre_count) { + flag = true; + testapp_print("email_add_account succeed.\n"); + } else { + testapp_print("account setting...\n"); + } + + sleep(3); + if (loop_count == 20) { + testapp_print("email_add_account timeout.\n"); + break; + } + loop_count++; + + } while (flag == false); + + return TRUE; } -- cgit v1.2.3