Add line coverage tags 40/185540/1 accepted/tizen/unified/20180810.132627 submit/tizen/20180809.012922 submit/tizen/20180809.124208
authorsooyeon.kim <sooyeon.kim@samsung.com>
Tue, 31 Jul 2018 10:03:09 +0000 (19:03 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Tue, 31 Jul 2018 10:03:28 +0000 (19:03 +0900)
Change-Id: Ib7785c22ae0597488ba869ec81aeae35b4758959
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
src/vc_elm.c

index b8842668a21073fbc25e3a7b6a62e0f0a1a8677a..38621d3e9d50a14d7f8650c072032bb09b828021 100644 (file)
@@ -83,7 +83,7 @@ static int g_click_method = 0;
 static int __vc_elm_get_feature_enabled()
 {
        if (0 == g_feature_enabled) {
-               VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported");
+               VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_NOT_SUPPORTED;
        } else if (-1 == g_feature_enabled) {
                bool vc_supported = false;
@@ -91,18 +91,18 @@ static int __vc_elm_get_feature_enabled()
                if (0 == system_info_get_platform_bool(VC_ELM_FEATURE_PATH, &vc_supported)) {
                        if (0 == system_info_get_platform_bool(VC_ELM_MIC_FEATURE_PATH, &mic_supported)) {
                                if (false == vc_supported || false == mic_supported) {
-                                       VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported");
+                                       VC_ELM_LOG_DBG("[ERROR] Voice control feature NOT supported"); //LCOV_EXCL_LINE
                                        g_feature_enabled = 0;
                                        return VC_ELM_ERROR_NOT_SUPPORTED;
                                }
 
                                g_feature_enabled = 1;
                        } else {
-                               VC_ELM_LOG_DBG("[ERROR] Fail to get feature value");
+                               VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE
                                return VC_ELM_ERROR_NOT_SUPPORTED;
                        }
                } else {
-                       VC_ELM_LOG_DBG("[ERROR] Fail to get feature value");
+                       VC_ELM_LOG_DBG("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE
                        return VC_ELM_ERROR_NOT_SUPPORTED;
                }
        }
@@ -113,7 +113,7 @@ static int __check_privilege_initialize()
 {
        int ret = cynara_initialize(&p_cynara, NULL);
        if (CYNARA_API_SUCCESS != ret)
-               VC_ELM_LOG_ERR("[ERROR] fail to initialize");
+               VC_ELM_LOG_ERR("[ERROR] fail to initialize"); //LCOV_EXCL_LINE
 
        return ret == CYNARA_API_SUCCESS;
 }
@@ -131,7 +131,7 @@ static int __check_privilege(const char* uid, const char * privilege)
        fp = fopen(label_path, "r");
        if (fp != NULL) {
                if (0 >= fread(smack_label, 1, sizeof(smack_label), fp))
-                       VC_ELM_LOG_ERR("[ERROR] fail to fread");
+                       VC_ELM_LOG_ERR("[ERROR] fail to fread"); //LCOV_EXCL_LINE
 
                fclose(fp);
        }
@@ -160,16 +160,16 @@ static int __vc_elm_check_privilege()
        char uid[16];
 
        if (0 == g_privilege_allowed) {
-               VC_ELM_LOG_ERR("[ERROR] Permission is denied");
+               VC_ELM_LOG_ERR("[ERROR] Permission is denied"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_PERMISSION_DENIED;
        } else if (-1 == g_privilege_allowed) {
                if (false == __check_privilege_initialize()) {
-                       VC_ELM_LOG_ERR("[ERROR] privilege initialize is failed");
+                       VC_ELM_LOG_ERR("[ERROR] privilege initialize is failed"); //LCOV_EXCL_LINE
                        return VC_ELM_ERROR_PERMISSION_DENIED;
                }
                snprintf(uid, 16, "%d", getuid());
                if (false == __check_privilege(uid, VC_ELM_PRIVILEGE)) {
-                       VC_ELM_LOG_ERR("[ERROR] Permission is denied");
+                       VC_ELM_LOG_ERR("[ERROR] Permission is denied"); //LCOV_EXCL_LINE
                        g_privilege_allowed = 0;
                        __check_privilege_deinitialize();
                        return VC_ELM_ERROR_PERMISSION_DENIED;
@@ -186,7 +186,7 @@ void __vc_config_vtauto_changed_cb(keynode_t *key, void *data)
        (void)data; //unused parameter
        int ret = vconf_get_bool(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &g_is_vt_automode);
        if (0 != ret) {
-               VC_ELM_LOG_ERR("Fail to get vconfkey(%s), current voice touch mode(%d)", key, g_is_vt_automode);
+               VC_ELM_LOG_ERR("Fail to get vconfkey(%s), current voice touch mode(%d)", key, g_is_vt_automode); //LCOV_EXCL_LINE
        }
 
        return;
@@ -199,7 +199,7 @@ int vc_elm_initialize()
        }
 
        if (true == is_vc_elm_initialized) {
-               VC_ELM_LOG_DBG("vc elm is already initialized");
+               VC_ELM_LOG_DBG("vc elm is already initialized"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
 
@@ -232,7 +232,7 @@ int vc_elm_deinitialize()
        }
 
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_DBG("vc elm is already deinitialized");
+               VC_ELM_LOG_DBG("vc elm is already deinitialized"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
 
@@ -312,18 +312,18 @@ int vc_elm_foreach_supported_widgets(vc_elm_widget_cb callback, void *user_data)
        }
 
        if (NULL == callback) {
-               VC_ELM_LOG_ERR("Invalid parameters detected!");
+               VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
        data.callback = callback;
        data.data = user_data;
        hash = _vc_elm_core_get_config_widget_map();
        if (NULL == hash) {
-               VC_ELM_LOG_ERR("Config widget map is NULL!");
+               VC_ELM_LOG_ERR("Config widget map is NULL!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        eina_hash_foreach(hash, __hash_fn, &data);
@@ -345,21 +345,21 @@ int vc_elm_foreach_supported_actions(const char *widget, vc_elm_action_cb callba
        }
 
        if ((NULL == widget) || (NULL == callback)) {
-               VC_ELM_LOG_ERR("Invalid parameters detected!");
+               VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
        hash = _vc_elm_core_get_config_widget_map();
        if (NULL == hash) {
-               VC_ELM_LOG_ERR("Config widget map is NULL!");
+               VC_ELM_LOG_ERR("Config widget map is NULL!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        actions_list = (Eina_List *)eina_hash_find(hash, widget);
        if (NULL == actions_list) {
-               VC_ELM_LOG_ERR("Action list is NULL!");
+               VC_ELM_LOG_ERR("Action list is NULL!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        EINA_LIST_FOREACH(actions_list, l, action_tag) {
@@ -384,27 +384,27 @@ int vc_elm_get_action_command(const char *action, char **command)
        }
 
        if ((NULL == action) || (NULL == command)) {
-               VC_ELM_LOG_ERR("Invalid parameters detected!");
+               VC_ELM_LOG_ERR("Invalid parameters detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
        hash = _vc_elm_core_get_config_action_map();
        if (NULL == hash) {
-               VC_ELM_LOG_ERR("Config action map is NULL!");
+               VC_ELM_LOG_ERR("Config action map is NULL!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        command_name = eina_hash_find(_vc_elm_core_get_config_action_map(), action);
        if (NULL == command_name) {
-               VC_ELM_LOG_ERR("No command for given action name!");
+               VC_ELM_LOG_ERR("No command for given action name!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        len = strlen(command_name) + 1;
        *command = (char *)calloc(len, sizeof(char));
        if (NULL == *command) {
-               VC_ELM_LOG_ERR("Can not allocate memory!");
+               VC_ELM_LOG_ERR("Can not allocate memory!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OPERATION_FAILED;
        }
        memcpy(*command, command_name, len);
@@ -424,26 +424,26 @@ int vc_elm_create_object(Evas_Object *object, vc_elm_h *vc_elm)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL");
+               VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if ((NULL == object) || (!elm_object_widget_check(object))) {
-               VC_ELM_LOG_ERR("Invalid parameters detected! Incorrect (Evas_Object *)");
+               VC_ELM_LOG_ERR("Invalid parameters detected! Incorrect (Evas_Object *)"); //LCOV_EXCL_LINE
                *vc_elm = NULL;
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
        if (!_vc_elm_core_register_default_widget(_get_ui_object_name(object), EINA_FALSE, NULL) || (NULL == eina_hash_find(_vc_elm_core_get_config_widget_map(), elm_widget_type_get(object)))) {
-               VC_ELM_LOG_ERR("Not supported widget");
+               VC_ELM_LOG_ERR("Not supported widget"); //LCOV_EXCL_LINE
                *vc_elm = NULL;
                return VC_ELM_ERROR_NOT_SUPPORTED;
        }
        handler = (vc_elm_s *)calloc(1, sizeof(vc_elm_s));
        if (NULL == handler) {
-               VC_ELM_LOG_ERR("Calloc function returned NULL");
+               VC_ELM_LOG_ERR("Calloc function returned NULL"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_OUT_OF_MEMORY;
        }
        handler->type = VC_ELM_TYPE_EVAS_OBJECT;
@@ -467,21 +467,21 @@ int vc_elm_create_item(Elm_Object_Item *item, vc_elm_h *vc_elm)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL");
+               VC_ELM_LOG_ERR("Invalid parameters detected! (vc_elm_h *) poiter is NULL"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (NULL == item) {
-               VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) poiter is NULL");
+               VC_ELM_LOG_ERR("Invalid parameters detected! (Elm_Object_Item *) poiter is NULL"); //LCOV_EXCL_LINE
                *vc_elm = NULL;
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
        handler = (vc_elm_s *)calloc(1, sizeof(vc_elm_s));
        if (NULL == handler) {
-               VC_ELM_LOG_ERR("Calloc function returned NULL");
+               VC_ELM_LOG_ERR("Calloc function returned NULL"); //LCOV_EXCL_LINE
                *vc_elm = NULL;
                return VC_ELM_ERROR_OUT_OF_MEMORY;
        }
@@ -508,19 +508,19 @@ int vc_elm_destroy(vc_elm_h vc_elm)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        handler = (vc_elm_s *)vc_elm;
        type = handler->type;
        if (!((VC_ELM_TYPE_EVAS_OBJECT == type) || (VC_ELM_TYPE_ITEM == type))) {
-               VC_ELM_LOG_ERR("Invalid type detected!");
+               VC_ELM_LOG_ERR("Invalid type detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
 
        list = eina_list_data_find_list(g_handlers_list, handler);
        if (NULL == list) {
-               VC_ELM_LOG_ERR("Bad handler pointer detected!");
+               VC_ELM_LOG_ERR("Bad handler pointer detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        g_handlers_list = eina_list_remove_list(g_handlers_list, list);
@@ -544,7 +544,7 @@ int vc_elm_set_command(vc_elm_h vc_elm, const char *command)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -573,7 +573,7 @@ int vc_elm_unset_command(vc_elm_h vc_elm)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -602,7 +602,7 @@ int vc_elm_set_command_hint(vc_elm_h vc_elm, const char* hint)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -631,7 +631,7 @@ int vc_elm_unset_command_hint(vc_elm_h vc_elm)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -660,7 +660,7 @@ int vc_elm_set_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e direct
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -690,7 +690,7 @@ int vc_elm_get_command_hint_direction(vc_elm_h vc_elm, vc_elm_direction_e *direc
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -719,7 +719,7 @@ int vc_elm_set_command_hint_offset(vc_elm_h vc_elm, int pos_x, int pos_y)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -749,11 +749,11 @@ int vc_elm_get_command_hint_offset(vc_elm_h vc_elm, int *pos_x, int *pos_y)
        }
 
        if (NULL == vc_elm) {
-               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!");
+               VC_ELM_LOG_ERR("Invalid vc_elm parameter detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        if ((NULL == pos_x) || (NULL == pos_y)) {
-               VC_ELM_LOG_ERR("Invalid position poiters detected!");
+               VC_ELM_LOG_ERR("Invalid position poiters detected!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_PARAMETER;
        }
        type = handler->type;
@@ -779,7 +779,7 @@ int vc_elm_set_current_language_changed_cb(vc_elm_current_language_changed_cb ca
        }
 
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }
 
@@ -802,7 +802,7 @@ int vc_elm_unset_current_language_changed_cb(void)
        }
 
        if (false == is_vc_elm_initialized) {
-               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!");
+               VC_ELM_LOG_ERR("Invalid state detected! Library not initialized!"); //LCOV_EXCL_LINE
                return VC_ELM_ERROR_INVALID_STATE;
        }