utc_evas_event_feed_mouse_key: remove needless timer 28/206128/1
authorYeongjong Lee <yj34.lee@samsung.com>
Tue, 14 May 2019 11:46:51 +0000 (20:46 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 14 May 2019 11:47:29 +0000 (20:47 +0900)
Save 8 seconds.

Change-Id: Id3b80bd4be1563ebfb348178fd0b01ede9523f0d

TC/evas/canvas/evas_events/utc_evas_event_feed_mouse_key.c

index 8bcc040a8788cae0574a3cf5fcb7258301d9e18f..d8d206255b2d2f0385d830b081b3759cbdcd519b 100644 (file)
@@ -106,39 +106,6 @@ _key_up(void *data, Evas *_evas EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *
      is_key_up = EINA_TRUE;
 }
 
-static Eina_Bool
-_feed_event(void *data)
-{
-
-   evas_event_feed_mouse_wheel(evas, 1, 5, 0, &cb_data);
-   evas_event_feed_axis_update(evas, 10, 0, 0, 1, &axis, &cb_data);
-
-   evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
-   evas_event_feed_mouse_cancel(evas, 0, &cb_data);
-
-   evas_event_feed_hold(evas, 1, 0, NULL);
-
-   return EINA_FALSE;
-}
-
-static Eina_Bool
-_feed_key_event(void *data)
-{
-   evas_event_feed_key_down_with_keycode(evas, "f", "f", "f", "f", 0, NULL, 102);
-   evas_event_feed_key_up_with_keycode(evas, "f", "f", "f", "f", 0, NULL, 102);
-
-   return EINA_FALSE;
-}
-
-static Eina_Bool
-_close_loop(void *data)
-{
-   ecore_main_loop_quit();
-
-   return EINA_FALSE;
-}
-
-
 /**
  * @addtogroup evas_event_feed_mouse_key
  * @{
@@ -169,13 +136,11 @@ _close_loop(void *data)
  * @step 10 Add a callback function of EVAS_CALLBACK_AXIS_UPDATE event to an rectangle object with user_data.
  * @step 11 Add a callback function of EVAS_CALLBACK_MOUSE_UP event to an rectangle object with user_data.
  * @step 12 Add a callback function of EVAS_CALLBACK_HOLD event to an rectangle object with user_data.
- * @step 13 Mouse in event feed.
- * @step 14 Set timer for mouse_wheel, axis_update, mouse_cancel, hold events feed.
- * @step 15 Set timer for preschedule termination of main loop.
- * @step 16 Start of main loop and wait for tested callbacks executing.
- * @step 17 Check static variables named is_mouse_wheel, is_axis_update, is_mouse_cancel, is_hold.
+ * @step 13 mouse_wheel, axis_update, mouse_cancel, hold, Mouse in events feed.
+ * @step 14 Start of main loop and wait for tested callbacks executing.
+ * @step 15 Check static variables named is_mouse_wheel, is_axis_update, is_mouse_cancel, is_hold.
  * If are equals 1 that feed events is triggered. In other cases error.
- * @step 18 Free an Ecore_Evas.
+ * @step 16 Free an Ecore_Evas.
  *
  * @passcondition Variables named is_mouse_wheel, is_axis_update, is_mouse_cancel, is_hold
  * must equals 1, and there is no segmentation fault.
@@ -203,22 +168,13 @@ START_TEST(utc_evas_event_feed_mouse_p)
 
    evas_event_feed_mouse_in(evas, 0, NULL);
 
-   Ecore_Timer *timer_feed = ecore_timer_add(1.0, _feed_event, NULL);
-   if (!timer_feed)
-     {
-        ecore_evas_free(ee);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
+   evas_event_feed_mouse_wheel(evas, 1, 5, 0, &cb_data);
+   evas_event_feed_axis_update(evas, 10, 0, 0, 1, &axis, &cb_data);
 
-   Ecore_Timer *timer_exit = ecore_timer_add(4.0, _close_loop, NULL);
-   if (!timer_exit)
-     {
-        ecore_timer_del(timer_feed);
-        ecore_evas_free(ee);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
+   evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+   evas_event_feed_mouse_cancel(evas, 0, &cb_data);
 
-   ecore_main_loop_begin();
+   evas_event_feed_hold(evas, 1, 0, NULL);
 
    if (!is_mouse_wheel || !is_axis_update || !is_mouse_cancel || !is_hold)
      {
@@ -255,7 +211,6 @@ END_TEST
  * @step 14 Mouse in event feed.
  * @step 15 Mouse down event feed.
  * @step 16 Mouse down event feed.
- * @step 17 Set timer for preschedule termination of main loop.
  * @step 17 Start of main loop and wait for tested callbacks executing.
  * @step 18 Call evas_event_down_count_get function to get expected number of mouse presses.
  * @step 19 Free an Ecore_Evas.
@@ -286,15 +241,6 @@ START_TEST(utc_evas_event_down_count_get_p)
    evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
    evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
 
-   Ecore_Timer *timer_exit = ecore_timer_add(4.0, _close_loop, NULL);
-   if (!timer_exit)
-     {
-        ecore_evas_free(ee);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
-
-   ecore_main_loop_begin();
-
    if (evas_event_down_count_get(evas) != count_down)
      {
         ecore_evas_free(ee);
@@ -332,13 +278,11 @@ END_TEST
  * @step 9 Sets focus to the rectangle object
  * @step 10 Add a callback function of EVAS_CALLBACK_KEY_DOWN event to an rectangle object with user_data.
  * @step 11 Add a callback function of EVAS_CALLBACK_KEY_UP event to an rectangle object with user_data.
- * @step 12 Mouse in event feed.
- * @step 13 Set timer for key_up_with_keycode, key_down_with_keycode events feed.
- * @step 14 Set timer for preschedule termination of main loop.
- * @step 15 Start of main loop and wait for tested callbacks executing.
- * @step 16 Check static variables named is_key_up, is_key_down.
+ * @step 12 key_up_with_keycode, key_down_with_keycode, Mouse in events feed.
+ * @step 13 Start of main loop and wait for tested callbacks executing.
+ * @step 14 Check static variables named is_key_up, is_key_down.
  * If are equals 1 that feed events is triggered. In other cases error.
- * @step 17 Free an Ecore_Evas.
+ * @step 15 Free an Ecore_Evas.
  *
  * @passcondition Variables named is_key_up, is_key_down must equals 1, and there is no segmentation fault.
  * @}
@@ -362,21 +306,8 @@ START_TEST(utc_evas_event_feed_key_down_p)
    evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN, _key_down, &cb_data);
    evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_UP, _key_up, &cb_data);
 
-   Ecore_Timer *timer_feed = ecore_timer_add(1.0, _feed_key_event, NULL);
-   if (!timer_feed)
-     {
-        ecore_evas_free(ee);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
-
-   Ecore_Timer *timer_exit = ecore_timer_add(4.0, _close_loop, NULL);
-   if (!timer_exit)
-     {
-        ecore_evas_free(ee);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
-
-   ecore_main_loop_begin();
+   evas_event_feed_key_down_with_keycode(evas, "f", "f", "f", "f", 0, NULL, 102);
+   evas_event_feed_key_up_with_keycode(evas, "f", "f", "f", "f", 0, NULL, 102);
 
    if (!is_key_down || !is_key_up)
      {