From 828b2162a926b8faf350ebd054afa07bff19e638 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Tue, 22 Nov 2022 18:04:08 +0900 Subject: [PATCH] Rearrange coverage excluding scope - Contents: This patch fixes the comment for excluding line coverage checker. Through this code, the code which is not covered by unit test is excluded from line coverage checking. Change-Id: Ib7f5b4a683e3f5bd10752d1fd0982e6cd917ad17 Signed-off-by: Suyeon Hwang --- client/vc.c | 25 ++++++++++--------------- client/vc_client.c | 12 +++++------- client/vc_tidl.c | 17 ++++++++++++++++- common/vc_command.c | 8 ++++++++ 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/client/vc.c b/client/vc.c index d0d19db..60b67b1 100644 --- a/client/vc.c +++ b/client/vc.c @@ -366,7 +366,7 @@ int vc_initialize(void) ret = vc_config_mgr_initialize(g_pid); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to init config manager : %s", - __vc_get_error_code(__vc_convert_config_error_code(ret))); //LCOV_EXCL_LINE + __vc_get_error_code(__vc_convert_config_error_code(ret))); //LCOV_EXCL_LINE vc_client_destroy(); //LCOV_EXCL_LINE return __vc_convert_config_error_code(ret); //LCOV_EXCL_LINE } @@ -665,7 +665,7 @@ int vc_prepare(void) vc_state_e state; if (0 != vc_client_get_client_state(&state)) { - SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available"); //LCOV_EXCL_LINE + SLOG(LOG_ERROR, TAG_VCC, "[ERROR] A handle is not available"); return VC_ERROR_INVALID_STATE; } @@ -678,7 +678,6 @@ int vc_prepare(void) return VC_ERROR_NONE; } -//LCOV_EXCL_START int vc_prepare_sync(void) { int ret; @@ -721,7 +720,6 @@ int vc_prepare_sync(void) return VC_ERROR_NONE; } -//LCOV_EXCL_STOP int vc_unprepare(void) { @@ -867,19 +865,16 @@ int vc_get_service_state(vc_service_state_e* state) return VC_ERROR_OPERATION_FAILED; } - SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get Service State"); *state = service_state; switch (*state) { - //LCOV_EXCL_START case VC_SERVICE_STATE_NONE: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'None'"); break; case VC_SERVICE_STATE_READY: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Ready'"); break; case VC_SERVICE_STATE_RECORDING: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Recording'"); break; case VC_SERVICE_STATE_PROCESSING: SLOG(LOG_DEBUG, TAG_VCC, "Current service state is 'Processing'"); break; default: SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Invalid state"); - //LCOV_EXCL_STOP } SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Get Service State DONE"); @@ -1252,7 +1247,6 @@ int vc_unset_command_list(int type) return ret; } -//LCOV_EXCL_START int vc_set_command_list_from_file(const char* file_path, int type) { int ret; @@ -1304,7 +1298,6 @@ int vc_set_command_list_from_file(const char* file_path, int type) SLOG(LOG_DEBUG, TAG_VCC, "@@@ [Client] Set Command list from file DONE"); return ret; } -//LCOV_EXCL_STOP #if 0 int vc_get_exclusive_command_option(bool* value) @@ -1563,7 +1556,6 @@ int vc_request_cancel(void) } #endif -//LCOV_EXCL_START static void __vc_notify_error(void *data) { vc_error_cb callback = NULL; @@ -1626,6 +1618,7 @@ static void __vc_notify_state_changed(void *data) } } +//LCOV_EXCL_START static Eina_Bool __vc_notify_result(void *data) { char* temp_text; @@ -1772,7 +1765,6 @@ int vc_unset_result_cb(void) return VC_ERROR_NONE; } -//LCOV_EXCL_START int __vc_cb_service_state(int state) { vc_service_state_e current_state = (vc_service_state_e)state; @@ -1814,7 +1806,6 @@ int __vc_cb_manager_pid(int manager_pid) return VC_ERROR_NONE; } -//LCOV_EXCL_STOP int vc_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data) { @@ -2018,7 +2009,6 @@ int vc_set_invocation_name(const char* name) return ret; } -//LCOV_EXCL_START int vc_set_server_dialog(const char* app_id, const char* credential) { vc_state_e state; @@ -2065,6 +2055,7 @@ int vc_set_server_dialog(const char* app_id, const char* credential) do { ret = vc_tidl_request_set_server_dialog(pid, tmp_appid, credential); if (0 != ret) { + //LCOV_EXCL_START if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(VC_STATE_INITIALIZED); if (0 == vc_prepare_sync()) { @@ -2083,6 +2074,7 @@ int vc_set_server_dialog(const char* app_id, const char* credential) break; } } + //LCOV_EXCL_STOP } } while (0 != ret); @@ -2137,6 +2129,7 @@ int vc_unset_server_dialog(const char* app_id) do { ret = vc_tidl_request_set_server_dialog(pid, tmp_appid, credential); if (0 != ret) { + //LCOV_EXCL_START if (VC_ERROR_INVALID_PARAMETER == ret && false == is_prepared) { vc_client_set_client_state(VC_STATE_INITIALIZED); if (0 == vc_prepare_sync()) { @@ -2155,6 +2148,7 @@ int vc_unset_server_dialog(const char* app_id) break; } } + //LCOV_EXCL_STOP } } while (0 != ret); @@ -2165,7 +2159,6 @@ int vc_unset_server_dialog(const char* app_id) return ret; } -//LCOV_EXCL_STOP int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_start) { @@ -2868,6 +2861,7 @@ int vc_tts_get_synthesized_audio_details(int* rate, vc_audio_channel_e* channel, return ret; } +//LCOV_EXCL_STOP int vc_tts_set_streaming_cb(vc_tts_streaming_cb callback, void* user_data) { @@ -2914,6 +2908,7 @@ int vc_tts_unset_streaming_cb(void) return VC_ERROR_NONE; } +//LCOV_EXCL_START int __vc_cb_utterance_status(int utt_id, int utt_status) { vc_tts_utterance_status_cb callback = NULL; @@ -2929,6 +2924,7 @@ int __vc_cb_utterance_status(int utt_id, int utt_status) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_tts_set_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data) { @@ -2973,4 +2969,3 @@ int vc_tts_unset_utterance_status_cb(void) return VC_ERROR_NONE; } -//LCOV_EXCL_STOP diff --git a/client/vc_client.c b/client/vc_client.c index 30a6bed..5ae8f29 100644 --- a/client/vc_client.c +++ b/client/vc_client.c @@ -205,7 +205,6 @@ int vc_client_set_service_state_changed_cb(vc_service_state_changed_cb callback, return VC_ERROR_NONE; } -//LCOV_EXCL_START int vc_client_get_service_state_changed_cb(vc_service_state_changed_cb* callback, void** user_data) { /* check handle */ @@ -217,7 +216,6 @@ int vc_client_get_service_state_changed_cb(vc_service_state_changed_cb* callback return VC_ERROR_NONE; } -//LCOV_EXCL_STOP int vc_client_set_state_changed_cb(vc_state_changed_cb callback, void* user_data) { @@ -231,7 +229,6 @@ int vc_client_set_state_changed_cb(vc_state_changed_cb callback, void* user_data return VC_ERROR_NONE; } -//LCOV_EXCL_START int vc_client_get_state_changed_cb(vc_state_changed_cb* callback, void** user_data) { /* check handle */ @@ -243,7 +240,6 @@ int vc_client_get_state_changed_cb(vc_state_changed_cb* callback, void** user_da return VC_ERROR_NONE; } -//LCOV_EXCL_STOP int vc_client_set_current_lang_changed_cb(vc_current_language_changed_cb callback, void* user_data) { @@ -283,7 +279,6 @@ int vc_client_set_error_cb(vc_error_cb callback, void* user_data) return VC_ERROR_NONE; } -//LCOV_EXCL_START int vc_client_get_error_cb(vc_error_cb* callback, void** user_data) { /* check handle */ @@ -295,7 +290,6 @@ int vc_client_get_error_cb(vc_error_cb* callback, void** user_data) return VC_ERROR_NONE; } -//LCOV_EXCL_STOP /* set/get option */ int vc_client_set_service_state(vc_service_state_e state) @@ -383,6 +377,7 @@ int vc_client_get_invocation_name(char** invocation_name) return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_client_set_is_foreground(bool value) { /* check handle */ @@ -404,7 +399,6 @@ int vc_client_get_is_foreground(bool* value) return VC_ERROR_NONE; } -//LCOV_EXCL_START #if 0 int vc_client_set_exclusive_cmd(vc_h vc, bool value) { @@ -586,6 +580,7 @@ int vc_client_set_tts_streaming_cb(vc_tts_streaming_cb callback, void* user_data return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_client_get_tts_streaming_cb(vc_tts_streaming_cb* callback, void** user_data) { /* check handle */ @@ -597,6 +592,7 @@ int vc_client_get_tts_streaming_cb(vc_tts_streaming_cb* callback, void** user_da return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_client_set_tts_utterance_status_cb(vc_tts_utterance_status_cb callback, void* user_data) { @@ -610,6 +606,7 @@ int vc_client_set_tts_utterance_status_cb(vc_tts_utterance_status_cb callback, v return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_client_get_tts_utterance_status_cb(vc_tts_utterance_status_cb* callback, void** user_data) { /* check handle */ @@ -621,6 +618,7 @@ int vc_client_get_tts_utterance_status_cb(vc_tts_utterance_status_cb* callback, return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_client_set_start_listening(bool is_listening_started) { diff --git a/client/vc_tidl.c b/client/vc_tidl.c index b38097e..d1b39ec 100644 --- a/client/vc_tidl.c +++ b/client/vc_tidl.c @@ -119,6 +119,7 @@ static void __on_disconnected(rpc_port_proxy_vc_proxy_vc_h h, void* user_data) } } +//LCOV_EXCL_START static void __on_rejected(rpc_port_proxy_vc_proxy_vc_h h, void* user_data) { unsigned int pid = (uintptr_t)user_data; @@ -131,6 +132,7 @@ static void __on_rejected(rpc_port_proxy_vc_proxy_vc_h h, void* user_data) SLOG(LOG_INFO, TAG_VCC, "[INFO] Rejected from server(%d)", pid); } +//LCOV_EXCL_STOP static rpc_port_proxy_vc_proxy_vc_h __create_rpc_port(int pid, const char* engine_app_id) @@ -183,6 +185,7 @@ static int __request_tidl_connect_sync(vc_tidl_info_s* info) } +//LCOV_EXCL_START static void __notify_cb(void* user_data, int pid, bundle* msg) { // corresponding to listener_event_callback @@ -264,6 +267,7 @@ void __feedback_cb(void *user_data, int utt_id, int event, rpc_port_proxy_vc_pro } } +//LCOV_EXCL_STOP static int __create_notify_callback_handle(vc_tidl_info_s* info) { @@ -289,6 +293,7 @@ static int __create_notify_callback_handle(vc_tidl_info_s* info) return VC_ERROR_NONE; } +//LCOV_EXCL_START static int __create_feedback_callback_handle(vc_tidl_info_s* info) { if (NULL == info) { @@ -312,6 +317,7 @@ static int __create_feedback_callback_handle(vc_tidl_info_s* info) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP static int __invoke_register_notify_callback(int pid, vc_tidl_info_s* info) { @@ -331,6 +337,7 @@ static int __invoke_register_notify_callback(int pid, vc_tidl_info_s* info) return VC_ERROR_NONE; } +//LCOV_EXCL_START static int __invoke_register_feedback_callback(int pid, vc_tidl_info_s* info) { if (info->register_feedback_callback_invoked) { @@ -348,6 +355,7 @@ static int __invoke_register_feedback_callback(int pid, vc_tidl_info_s* info) info->register_feedback_callback_invoked = true; return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_tidl_open_connection() { @@ -452,6 +460,7 @@ int vc_tidl_request_hello_sync() return VC_ERROR_NONE; } +//LCOV_EXCL_START static int __convert_unhandled_error(int ret) { if (RPC_PORT_ERROR_IO_ERROR == ret || RPC_PORT_ERROR_OUT_OF_MEMORY == ret) { @@ -460,6 +469,7 @@ static int __convert_unhandled_error(int ret) return ret; } +//LCOV_EXCL_STOP int vc_tidl_request_initialize(int pid, int* mgr_pid, int* service_state, int* daemon_pid) { @@ -480,7 +490,7 @@ int vc_tidl_request_initialize(int pid, int* mgr_pid, int* service_state, int* d return ret; } - SLOG(LOG_DEBUG, TAG_VCC, "@@ vc initialize : mgr = %d service = %d daemon_pid = %d", *mgr_pid, *service_state, *daemon_pid); //LCOV_EXCL_LINE + SLOG(LOG_DEBUG, TAG_VCC, "@@ vc initialize : mgr = %d service = %d daemon_pid = %d", *mgr_pid, *service_state, *daemon_pid); return VC_ERROR_NONE; } @@ -557,6 +567,7 @@ int vc_tidl_request_unset_command(int pid, vc_cmd_type_e cmd_type) return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_tidl_request_set_foreground(int pid, bool value) { // method no reply --> async @@ -581,6 +592,7 @@ int vc_tidl_request_set_foreground(int pid, bool value) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_tidl_request_set_server_dialog(int pid, const char* app_id, const char* credential) { @@ -655,6 +667,7 @@ int vc_tidl_request_is_system_command_valid(int pid, bool* is_sys_cmd_valid) return VC_ERROR_NONE; } +//LCOV_EXCL_START /* Authority */ int vc_tidl_request_auth_enable(int pid, int mgr_pid) { @@ -853,3 +866,5 @@ int vc_tidl_request_get_tts_audio_format(int pid, int* rate, vc_audio_channel_e* return VC_ERROR_NONE; } +//LCOV_EXCL_STOP + diff --git a/common/vc_command.c b/common/vc_command.c index f61a7a5..77e8016 100644 --- a/common/vc_command.c +++ b/common/vc_command.c @@ -805,6 +805,7 @@ int vc_cmd_set_id(vc_cmd_h vc_command, int id) return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_cmd_get_id(vc_cmd_h vc_command, int* id) { if (0 != __vc_cmd_get_feature_enabled()) { @@ -827,6 +828,7 @@ int vc_cmd_get_id(vc_cmd_h vc_command, int* id) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_cmd_set_appid(vc_cmd_h vc_command, const char* appid) { @@ -984,6 +986,7 @@ int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command) return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_cmd_set_fixed_command(vc_cmd_h vc_command, const char* fixed) { if (0 != __vc_cmd_get_feature_enabled()) { @@ -1035,6 +1038,7 @@ int vc_cmd_get_fixed_command(vc_cmd_h vc_command, char** fixed) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_cmd_set_invocation_name(vc_cmd_h vc_command, const char* invocation_name) { @@ -1064,6 +1068,7 @@ int vc_cmd_set_invocation_name(vc_cmd_h vc_command, const char* invocation_name) return VC_ERROR_NONE; } +//LCOV_EXCL_START int vc_cmd_get_invocation_name(vc_cmd_h vc_command, char** invocation_name) { if (0 != __vc_cmd_get_feature_enabled()) { @@ -1086,6 +1091,7 @@ int vc_cmd_get_invocation_name(vc_cmd_h vc_command, char** invocation_name) SLOG(LOG_DEBUG, TAG_VCCMD, "[Get invocation name][%p] invocation_name(%s)", vc_command, *invocation_name); return VC_ERROR_NONE; } +//LCOV_EXCL_STOP int vc_cmd_set_type(vc_cmd_h vc_command, int type) { @@ -1273,6 +1279,7 @@ int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain) return VC_ERROR_NONE; } +//LCOV_EXCL_START /** * @brief Sets key value of command. * @@ -2321,3 +2328,4 @@ int vc_cmd_get_datetime(const char *text, time_t *result, char **remain) return VC_ERROR_NONE; } +//LCOV_EXCL_STOP -- 2.34.1