Add exclude section for impossible lines to be excuted in TCT 46/238846/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Sun, 19 Jul 2020 05:37:10 +0000 (14:37 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Sun, 19 Jul 2020 05:37:10 +0000 (14:37 +0900)
Change-Id: Ica4eeaea550e59ab98763da843495c3f53ebabab
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
inputmethod/src/inputmethod.cpp

index d379d93..f8e036f 100644 (file)
@@ -524,15 +524,17 @@ ime_error_e _check_privilege()
     }
 
     if (inputmethod_cynara_initialize() == false) {
+        //LCOV_EXCL_START
         g_permission_allowed = false;
         g_checked_privilege = true;
         LOGE("inputmethod_cynara_initialize () == false");
+        //LCOV_EXCL_STOP
         return IME_ERROR_PERMISSION_DENIED;
     }
 
     snprintf(uid, 16, "%d", getuid());
     if (check_privilege(uid, IME_PRIVILEGE) == false) {
-        LOGE("check_privilege(uid, IME_PRIVILEGE) == false. uid : %s", uid);
+        LOGE("check_privilege(uid, IME_PRIVILEGE) == false. uid : %s", uid); //LCOV_EXCL_LINE
         ret = IME_ERROR_PERMISSION_DENIED;
     }
 
@@ -564,8 +566,10 @@ EXPORT_API int ime_run(ime_callback_s *basic_cb, void *user_data)
     ime_error_e retVal = IME_ERROR_NONE;
 
     if (g_running) {
+        //LCOV_EXCL_START
         LOGE("inputmethod main loop is already running.");
         return IME_ERROR_OPERATION_FAILED;
+        //LCOV_EXCL_STOP
     }
 
     if (!basic_cb) {
@@ -586,6 +590,7 @@ EXPORT_API int ime_run(ime_callback_s *basic_cb, void *user_data)
         return IME_ERROR_NO_CALLBACK_FUNCTION;
     }
 
+    //LCOV_EXCL_START
     g_user_data = user_data;
     g_running = true;
 
@@ -606,6 +611,7 @@ EXPORT_API int ime_run(ime_callback_s *basic_cb, void *user_data)
     g_running = false;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data)
@@ -1051,6 +1057,7 @@ EXPORT_API int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1058,6 +1065,7 @@ EXPORT_API int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask
         g_core.forward_key_event(-1, NULL, (sclu32)keycode, (sclu16)keymask);
     else
         g_core.send_key_event(-1, NULL, (sclu32)keycode, (sclu16)keymask);
+    //LCOV_EXCL_STOP
 
     return IME_ERROR_NONE;
 }
@@ -1076,6 +1084,7 @@ EXPORT_API int ime_commit_string(const char *str)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1083,6 +1092,7 @@ EXPORT_API int ime_commit_string(const char *str)
     g_core.commit_string(-1, NULL, str);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_show_preedit_string(void)
@@ -1094,12 +1104,14 @@ EXPORT_API int ime_show_preedit_string(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.show_preedit_string(-1, NULL);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_hide_preedit_string(void)
@@ -1111,12 +1123,14 @@ EXPORT_API int ime_hide_preedit_string(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.hide_preedit_string(-1, NULL);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_update_preedit_string(const char *str, Eina_List *attrs)
@@ -1133,6 +1147,7 @@ EXPORT_API int ime_update_preedit_string(const char *str, Eina_List *attrs)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1154,6 +1169,7 @@ EXPORT_API int ime_update_preedit_string(const char *str, Eina_List *attrs)
     g_core.update_preedit_string(-1, NULL, str, attrv);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
@@ -1170,12 +1186,14 @@ EXPORT_API int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.get_surrounding_text(NULL, maxlen_before, maxlen_after);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_delete_surrounding_text(int offset, int len)
@@ -1192,6 +1210,7 @@ EXPORT_API int ime_delete_surrounding_text(int offset, int len)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1199,6 +1218,7 @@ EXPORT_API int ime_delete_surrounding_text(int offset, int len)
     g_core.delete_surrounding_text(offset, len);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_get_surrounding_text(int maxlen_before, int maxlen_after, char **text, int *cursor_pos)
@@ -1215,6 +1235,7 @@ EXPORT_API int ime_get_surrounding_text(int maxlen_before, int maxlen_after, cha
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1230,6 +1251,7 @@ EXPORT_API int ime_get_surrounding_text(int maxlen_before, int maxlen_after, cha
         *cursor_pos = cursor;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_set_selection(int start, int end)
@@ -1246,6 +1268,7 @@ EXPORT_API int ime_set_selection(int start, int end)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1253,6 +1276,7 @@ EXPORT_API int ime_set_selection(int start, int end)
     g_core.set_selection(start, end);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_get_selected_text(char **text)
@@ -1269,12 +1293,14 @@ EXPORT_API int ime_get_selected_text(char **text)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.get_selection_text(text);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API Evas_Object* ime_get_main_window(void)
@@ -1285,9 +1311,11 @@ EXPORT_API Evas_Object* ime_get_main_window(void)
 
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) {
+        //LCOV_EXCL_START
         LOGE("_check_privilege returned %d.", retVal);
         set_last_result(retVal);
         return NULL;
+        //LCOV_EXCL_STOP
     }
 
     if (!g_running) {
@@ -1296,6 +1324,7 @@ EXPORT_API Evas_Object* ime_get_main_window(void)
         return NULL;
     }
 
+    //LCOV_EXCL_START
     win = static_cast<Evas_Object*>(g_core.get_main_window());
     if (win) {
         set_last_result(IME_ERROR_NONE);
@@ -1305,6 +1334,7 @@ EXPORT_API Evas_Object* ime_get_main_window(void)
     }
 
     return win;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_set_size(int portrait_width, int portrait_height, int landscape_width, int landscape_height)
@@ -1323,6 +1353,7 @@ EXPORT_API int ime_set_size(int portrait_width, int portrait_height, int landsca
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1335,6 +1366,7 @@ EXPORT_API int ime_set_size(int portrait_width, int portrait_height, int landsca
     g_core.set_keyboard_size_hints(portrait_size, landscape_size);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_create_option_window(void)
@@ -1351,6 +1383,7 @@ EXPORT_API int ime_create_option_window(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -1360,6 +1393,7 @@ EXPORT_API int ime_create_option_window(void)
         LOGW("IME_ERROR_OPERATION_FAILED");
         return IME_ERROR_OPERATION_FAILED;
     }
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_destroy_option_window(Evas_Object *window)
@@ -1381,12 +1415,14 @@ EXPORT_API int ime_destroy_option_window(Evas_Object *window)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.destroy_option_window(window);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 //LCOV_EXCL_START
@@ -1485,12 +1521,14 @@ EXPORT_API int ime_request_hide(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.request_ise_hide();
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 //LCOV_EXCL_START
@@ -1574,12 +1612,14 @@ EXPORT_API int ime_send_private_command(const char *command)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.send_private_command(command);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_commit_content(const char *content, const char *description, const char *mime_type)
@@ -1599,10 +1639,12 @@ EXPORT_API int ime_commit_content(const char *content, const char *description,
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     LOGI("content : '%s', description : '%s', mime_type : '%s'", content, description, mime_type);
     g_core.commit_content(content, description, mime_type);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout)
@@ -1622,9 +1664,11 @@ EXPORT_API int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Pan
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *layout = context->layout;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation)
@@ -1644,9 +1688,11 @@ EXPORT_API int ime_context_get_layout_variation(ime_context_h context, ime_layou
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *layout_variation = static_cast<ime_layout_variation_e>(context->layout_variation);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos)
@@ -1666,9 +1712,11 @@ EXPORT_API int ime_context_get_cursor_position(ime_context_h context, int *curso
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *cursor_pos = context->cursor_pos;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type)
@@ -1688,9 +1736,11 @@ EXPORT_API int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *autocapital_type = context->autocapital_type;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type)
@@ -1710,9 +1760,11 @@ EXPORT_API int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *return_key_type = context->return_key_type;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state)
@@ -1732,9 +1784,11 @@ EXPORT_API int ime_context_get_return_key_state(ime_context_h context, bool *ret
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *return_key_state = static_cast<bool>(context->return_key_disabled);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode)
@@ -1754,9 +1808,11 @@ EXPORT_API int ime_context_get_prediction_mode(ime_context_h context, bool *pred
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *prediction_mode = static_cast<bool>(context->prediction_allow);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_password_mode(ime_context_h context, bool *password_mode)
@@ -1776,9 +1832,11 @@ EXPORT_API int ime_context_get_password_mode(ime_context_h context, bool *passwo
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *password_mode = static_cast<bool>(context->password_mode);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint)
@@ -1798,9 +1856,11 @@ EXPORT_API int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *input_hint = context->input_hint;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi)
@@ -1820,9 +1880,11 @@ EXPORT_API int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_B
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *bidi = context->bidi_direction;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language)
@@ -1842,9 +1904,11 @@ EXPORT_API int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_P
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *language = context->language;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 //LCOV_EXCL_START
@@ -1888,12 +1952,14 @@ EXPORT_API int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_n
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     if (!dev_info->dev_name)
         *dev_name = strdup("");
     else
         *dev_name = strdup(dev_info->dev_name);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class)
@@ -1913,9 +1979,11 @@ EXPORT_API int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_D
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *dev_class = dev_info->dev_class;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass)
@@ -1935,9 +2003,11 @@ EXPORT_API int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IM
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     *dev_subclass = dev_info->dev_subclass;
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 //LCOV_EXCL_START
@@ -1996,6 +2066,7 @@ EXPORT_API int ime_input_device_rotary_get_direction(ime_input_device_event_h ev
         return IME_ERROR_OPERATION_FAILED;
     }
 
+    //LCOV_EXCL_START
     Ecore_Event_Detent_Rotate *rotary_device_event =
         static_cast<Ecore_Event_Detent_Rotate*>(device_event->event_data);
     if (rotary_device_event) {
@@ -2007,6 +2078,7 @@ EXPORT_API int ime_input_device_rotary_get_direction(ime_input_device_event_h ev
     }
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 //LCOV_EXCL_STOP
 
@@ -2058,9 +2130,11 @@ EXPORT_API int ime_set_floating_mode(bool floating_mode)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     g_core.set_floating_mode(floating_mode);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_set_floating_drag_start(void)
@@ -2075,9 +2149,11 @@ EXPORT_API int ime_set_floating_drag_start(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     g_core.set_floating_drag_enabled(true);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_set_floating_drag_end(void)
@@ -2092,9 +2168,11 @@ EXPORT_API int ime_set_floating_drag_end(void)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     g_core.set_floating_drag_enabled(false);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 //LCOV_EXCL_START
@@ -2166,12 +2244,14 @@ EXPORT_API int ime_update_input_panel_event(ime_event_type_e type, unsigned int
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
     g_core.update_input_context((sclu32)type, value);
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }
 
 EXPORT_API int ime_set_candidate_visibility_state(bool visible)
@@ -2183,6 +2263,7 @@ EXPORT_API int ime_set_candidate_visibility_state(bool visible)
         return IME_ERROR_NOT_RUNNING;
     }
 
+    //LCOV_EXCL_START
     retVal = _check_privilege();
     if (retVal != IME_ERROR_NONE) return retVal;
 
@@ -2192,4 +2273,5 @@ EXPORT_API int ime_set_candidate_visibility_state(bool visible)
         g_core.hide_candidate_string();
 
     return IME_ERROR_NONE;
+    //LCOV_EXCL_STOP
 }