From 7ed4236f7205c07bd0ebca7a4ae5d91773f69f57 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Thu, 7 Sep 2017 08:45:00 +0900 Subject: [PATCH] add LCOV_EXCL macros to avoid line coverage Change-Id: Id9ddd750390b20cecbc78821a4c1b3c03dbe8c7a --- src/efl_util.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/src/efl_util.c b/src/efl_util.c index 7b987e1..76c5cf0 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -1951,6 +1951,7 @@ fail: return NULL; } +/* LCOV_EXCL_START */ API int efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set) { @@ -1980,6 +1981,7 @@ efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set return EFL_UTIL_ERROR_NONE; } +/* LCOV_EXCL_STOP */ struct _efl_util_gesture_h { @@ -1991,6 +1993,7 @@ API int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0; API int EFL_UTIL_EVENT_GESTURE_TAP = 0; API int EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0; +/* LCOV_EXCL_START */ static void _cb_gesture_edge_swipe_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t edge EINA_UNUSED, uint32_t edge_size EINA_UNUSED, uint32_t start_point EINA_UNUSED, uint32_t end_point EINA_UNUSED, uint32_t error) { @@ -2060,6 +2063,7 @@ _cb_gesture_tap(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA ecore_event_add(EFL_UTIL_EVENT_GESTURE_TAP, ev, NULL, NULL); } +/* LCOV_EXCL_STOP */ static void _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t error) @@ -2067,6 +2071,7 @@ _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tize _eflutil.wl.gesture.request_notified = error; } +/* LCOV_EXCL_START */ static void _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface, uint32_t mode, uint32_t duration, int cx, int cy, uint32_t size, wl_fixed_t pressure) { @@ -2085,6 +2090,7 @@ _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gestu ecore_event_add(EFL_UTIL_EVENT_GESTURE_PALM_COVER, ev, NULL, NULL); } +/* LCOV_EXCL_STOP */ static void _cb_gesture_activate_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t type EINA_UNUSED, uint32_t active EINA_UNUSED, uint32_t error) @@ -2114,6 +2120,7 @@ _efl_util_gesture_convert_error(int ret) } } +/* LCOV_EXCL_START */ static int _efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data) { @@ -2392,6 +2399,7 @@ _efl_util_fd_cb(void *data, Ecore_Fd_Handler *hdl) return ECORE_CALLBACK_CANCEL; } } +/* LCOV_EXCL_STOP */ API efl_util_gesture_h efl_util_gesture_initialize(void) @@ -2402,25 +2410,25 @@ efl_util_gesture_initialize(void) gesture_h = (efl_util_gesture_h)calloc(1, sizeof(struct _efl_util_gesture_h)); if (!gesture_h) { - set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); - goto out; + set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */ + goto out; /* LCOV_EXCL_LINE */ } if (_wl_init() == (int)EINA_FALSE) { - set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); - goto out; + set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */ + goto out; /* LCOV_EXCL_LINE */ } while (!_eflutil.wl.gesture.proto) - wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); + wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); /* LCOV_EXCL_LINE */ if (_eflutil.wl.gesture.event_init <= 0) { if (ecore_event_init() <= 0) { - set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); - goto out; + set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */ + goto out; /* LCOV_EXCL_LINE */ } EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = ecore_event_type_new(); EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = ecore_event_type_new(); @@ -2442,12 +2450,14 @@ efl_util_gesture_initialize(void) return gesture_h; out: +/* LCOV_EXCL_START */ if (gesture_h) { free(gesture_h); gesture_h = NULL; } return gesture_h; +/* LCOV_EXCL_STOP */ } API int @@ -2501,8 +2511,8 @@ efl_util_gesture_edge_swipe_new(efl_util_gesture_h gesture_h, unsigned int finge data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Swipe_Grab_Data)); if (!data) { - set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); - return NULL; + set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ } data->base.type = TIZEN_GESTURE_TYPE_EDGE_SWIPE; @@ -2573,8 +2583,8 @@ efl_util_gesture_edge_drag_new(efl_util_gesture_h gesture_h, unsigned int finger data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Drag_Grab_Data)); if (!data) { - set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); - return NULL; + set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ } data->base.type = TIZEN_GESTURE_TYPE_EDGE_DRAG; @@ -2645,8 +2655,8 @@ efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, uns data = (Efl_Util_Gesture_Tap_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Tap_Grab_Data)); if (!data) { - set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); - return NULL; + set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ } data->base.type = TIZEN_GESTURE_TYPE_TAP; @@ -2691,8 +2701,8 @@ efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h) data = (Efl_Util_Gesture_Palm_Cover_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Palm_Cover_Grab_Data)); if (!data) { - set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); - return NULL; + set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ } data->base.type = TIZEN_GESTURE_TYPE_PALM_COVER; @@ -2721,6 +2731,7 @@ efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_ return EFL_UTIL_ERROR_NONE; } +/* LCOV_EXCL_START */ API int efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data) { @@ -2786,6 +2797,7 @@ efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data return ret; } +/* LCOV_EXCL_STOP */ API int efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data) @@ -2859,6 +2871,7 @@ efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl return ret; } +/* LCOV_EXCL_START */ API int efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active) { @@ -2878,6 +2891,7 @@ efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, E return ret; } +/* LCOV_EXCL_STOP */ API int efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active) -- 2.7.4