ecore_con: fix loop_quit timing 32/215532/1
authorJongmin Lee <jm105.lee@samsung.com>
Thu, 10 Oct 2019 08:03:10 +0000 (17:03 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Thu, 10 Oct 2019 08:03:10 +0000 (17:03 +0900)
Change-Id: I30c14c6319192e645c04fbb8d9c8b7b6fd99a790

TC/ecore/ecore_con/utc_ecore_con_ssl.c

index 7281c6aa817df1d76514f2a2aa9752322ffba54f..046ed09556d2839972d86c61a476604ef990a03b 100644 (file)
@@ -6,13 +6,16 @@
 #include <Ecore_Con.h>
 
 #define CLIENT_COUNT 2
+#define SERVER_COUNT 2
 
 static char sdata[] = "Server_info";
 static char cdata[] = "Client_info";
 static Eina_Bool server_upgraded = EINA_FALSE;
 static Eina_Bool client_upgraded = EINA_FALSE;
 static int added_client_count = 0;
+static int added_server_count = 0;
 static Eina_Bool wait_client = EINA_FALSE;
+static Eina_Bool wait_server = EINA_FALSE;
 
 static Eina_Bool
 _server_error(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
@@ -100,6 +103,13 @@ _add(void *data, int type EINA_UNUSED, void *ev)
              ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
           }
         ecore_con_server_flush(event->server);
+
+        added_server_count++;
+        if (wait_server && (added_server_count == SERVER_COUNT))
+          {
+             wait_server = EINA_FALSE;
+             ecore_main_loop_quit();
+          }
      }
 
    return ECORE_CALLBACK_RENEW;
@@ -667,6 +677,12 @@ START_TEST(utc_ecore_con_ssl_pack)
 
    ecore_main_loop_begin();
 
+   if (added_server_count != SERVER_COUNT)
+     {
+        wait_server = EINA_TRUE;
+        ecore_main_loop_begin();
+     }
+
    if (ecore_con_server_fd_get(client) == -1)
      {
         ecore_con_server_del(server);