From 912f01f762635186b0bb9a2a0ecce2dea13b7139 Mon Sep 17 00:00:00 2001 From: Randeep Singh Date: Fri, 15 Sep 2023 16:08:39 +0530 Subject: [PATCH] remove uncovered code Change-Id: I37919654615a4c0ded5f08c02dbac835c497c9b1 Signed-off-by: Randeep Singh --- common/ctsvc_record_result.c | 18 ++++++------------ common/ctsvc_socket.c | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/common/ctsvc_record_result.c b/common/ctsvc_record_result.c index 301ba47..51caeaf 100644 --- a/common/ctsvc_record_result.c +++ b/common/ctsvc_record_result.c @@ -78,7 +78,9 @@ static int __ctsvc_result_destroy(contacts_record_h record, bool delete_child) for (cursor = result->values; cursor; cursor = cursor->next) { ctsvc_result_value_s *data = cursor->data; if (data->type == CTSVC_VIEW_DATA_TYPE_STR) + /* LCOV_EXCL_START */ free(data->value.s); + /* LCOV_EXCL_STOP */ free(data); } g_slist_free(result->values); @@ -216,14 +218,17 @@ static int __ctsvc_result_set_int(contacts_record_h record, unsigned int propert ctsvc_result_value_s *data; if (CTSVC_VIEW_DATA_TYPE_INT != (CTSVC_VIEW_DATA_TYPE_INT & property_id)) { + /* LCOV_EXCL_START */ ERR("property_id is not int type."); return CONTACTS_ERROR_INVALID_PARAMETER; + /* LCOV_EXCL_STOP */ } for (cursor = result->values; cursor; cursor = cursor->next) { data = cursor->data; if (data->property_id == property_id) { #ifdef _CONTACTS_IPC_SERVER + /* LCOV_EXCL_START */ if (CTSVC_PROPERTY_PHONELOG_SIM_SLOT_NO == property_id || CTSVC_PROPERTY_PHONELOG_STAT_SIM_SLOT_NO == property_id) { CHECK_DIRTY_VAL(data->value.i, value, is_dirty); @@ -235,6 +240,7 @@ static int __ctsvc_result_set_int(contacts_record_h record, unsigned int propert data->value.i = value; } return CONTACTS_ERROR_NONE; + /* LCOV_EXCL_STOP */ } } @@ -278,20 +284,16 @@ static int __ctsvc_result_set_bool(contacts_record_h record, unsigned int proper data->value.b = value; return CONTACTS_ERROR_NONE; } else { - /* LCOV_EXCL_START */ ERR("use another get_type API, (type : %d)", data->type); return CONTACTS_ERROR_INVALID_PARAMETER; - /* LCOV_EXCL_STOP */ } } } data = calloc(1, sizeof(ctsvc_result_value_s)); if (NULL == data) { - /* LCOV_EXCL_START */ ERR("calloc() Fail"); return CONTACTS_ERROR_OUT_OF_MEMORY; - /* LCOV_EXCL_STOP */ } data->property_id = property_id; data->type = CTSVC_VIEW_DATA_TYPE_BOOL; @@ -324,10 +326,8 @@ static int __ctsvc_result_set_str(contacts_record_h record, unsigned int propert str_len = strlen(CTSVC_CONTACT_IMG_FULL_LOCATION) + strlen(str) + 2; full_path = calloc(1, str_len); if (NULL == full_path) { - /* LCOV_EXCL_START */ ERR("calloc() Fail"); return CONTACTS_ERROR_OUT_OF_MEMORY; - /* LCOV_EXCL_STOP */ } snprintf(full_path, str_len, "%s/%s", CTSVC_CONTACT_IMG_FULL_LOCATION, str); } @@ -345,10 +345,8 @@ static int __ctsvc_result_set_str(contacts_record_h record, unsigned int propert data = calloc(1, sizeof(ctsvc_result_value_s)); if (NULL == data) { - /* LCOV_EXCL_START */ ERR("calloc() Fail"); return CONTACTS_ERROR_OUT_OF_MEMORY; - /* LCOV_EXCL_STOP */ } data->property_id = property_id; data->type = CTSVC_VIEW_DATA_TYPE_STR; @@ -359,11 +357,9 @@ static int __ctsvc_result_set_str(contacts_record_h record, unsigned int propert str_len = strlen(CTSVC_CONTACT_IMG_FULL_LOCATION) + strlen(str) + 2; full_path = calloc(1, str_len); if (NULL == full_path) { - /* LCOV_EXCL_START */ ERR("calloc() Fail"); free(data); return CONTACTS_ERROR_OUT_OF_MEMORY; - /* LCOV_EXCL_STOP */ } snprintf(full_path, str_len, "%s/%s", CTSVC_CONTACT_IMG_FULL_LOCATION, str); } @@ -392,10 +388,8 @@ static int __ctsvc_result_get_bool(contacts_record_h record, unsigned int proper *out_value = data->value.b; return CONTACTS_ERROR_NONE; } else { - /* LCOV_EXCL_START */ ERR("use another get_type API, (type : %d)", data->type); return CONTACTS_ERROR_INVALID_PARAMETER; - /* LCOV_EXCL_STOP */ } } } diff --git a/common/ctsvc_socket.c b/common/ctsvc_socket.c index f072faf..ec8101f 100644 --- a/common/ctsvc_socket.c +++ b/common/ctsvc_socket.c @@ -239,7 +239,7 @@ static void __ctsvc_remove_invalid_msg(int fd, int size) } } } - +/* LCOV_EXCL_START */ int ctsvc_request_sim_import(int sim_slot_no, contacts_sim_import_progress_cb callback, void *user_data) { -- 2.7.4