fix test_app for account setting 31/99831/2
authorintae, jeon <intae.jeon@samsung.com>
Thu, 24 Nov 2016 08:06:09 +0000 (17:06 +0900)
committerintae jeon <intae.jeon@samsung.com>
Wed, 25 Jan 2017 22:57:46 +0000 (14:57 -0800)
Change-Id: I55ee5b156c67ff0799f719ea51603e0f58b1b1c2
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
utilities/test-application/testapp-account.c

index 79f634f873daa905cdc5d7776d21c3f8df89c033..0dc994f9e4082d8e26087a3ab93c5a22fb16a97f 100755 (executable)
@@ -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;
 }