From: InHong Han Date: Mon, 16 May 2022 09:16:47 +0000 (+0900) Subject: Add exclude section for impossible lines to be excuted in TCT X-Git-Tag: submit/tizen/20220517.003320~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e524fad0e61fb479e0650be65ee57da96899df4;p=platform%2Fcore%2Fuifw%2Fmulti-assistant.git Add exclude section for impossible lines to be excuted in TCT Change-Id: I527b4191a9274f181cdb60e5c98f46f7a6ef1968 --- diff --git a/client/ma.c b/client/ma.c index 4fe876d..ab7c612 100644 --- a/client/ma.c +++ b/client/ma.c @@ -66,7 +66,7 @@ static int __ma_get_feature_enabled() { if (0 == g_feature_enabled) { //LCOV_EXCL_START - MA_SLOGE("[ERROR] Multi-assistant feature NOT supported"); //LCOV_EXCL_LINE + MA_SLOGE("[ERROR] Multi-assistant feature NOT supported"); return MA_ERROR_NOT_SUPPORTED; //LCOV_EXCL_STOP } else if (-1 == g_feature_enabled) { @@ -75,19 +75,25 @@ static int __ma_get_feature_enabled() if (0 == system_info_get_platform_bool(MA_FEATURE_PATH, &ma_supported)) { if (0 == system_info_get_platform_bool(MA_MIC_FEATURE_PATH, &mic_supported)) { if (false == ma_supported || false == mic_supported) { - MA_SLOGE("[ERROR] Multi-assistant feature NOT supported"); //LCOV_EXCL_LINE + //LCOV_EXCL_START + MA_SLOGE("[ERROR] Multi-assistant feature NOT supported"); g_feature_enabled = 0; return MA_ERROR_NOT_SUPPORTED; + //LCOV_EXCL_STOP } g_feature_enabled = 1; } else { - MA_SLOGE("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE + //LCOV_EXCL_START + MA_SLOGE("[ERROR] Fail to get feature value"); return MA_ERROR_NOT_SUPPORTED; + //LCOV_EXCL_STOP } } else { - MA_SLOGE("[ERROR] Fail to get feature value"); //LCOV_EXCL_LINE + //LCOV_EXCL_START + MA_SLOGE("[ERROR] Fail to get feature value"); return MA_ERROR_NOT_SUPPORTED; + //LCOV_EXCL_STOP } } return 0; @@ -155,10 +161,12 @@ static int __ma_check_recorder_privilege() } snprintf(uid, 16, "%d", getuid()); if (false == __check_privilege(uid, MA_RECORDER_PRIVILEGE)) { - MA_SLOGE("[ERROR] Permission for recording is denied"); //LCOV_EXCL_LINE + //LCOV_EXCL_START + MA_SLOGE("[ERROR] Permission for recording is denied"); g_recorder_privilege_allowed = 0; __check_privilege_deinitialize(); return MA_ERROR_PERMISSION_DENIED; + //LCOV_EXCL_STOP } __check_privilege_deinitialize(); } @@ -183,10 +191,12 @@ static int __ma_check_volume_set_privilege() } snprintf(uid, 16, "%d", getuid()); if (false == __check_privilege(uid, MA_VOLUME_SET_PRIVILEGE)) { - MA_SLOGE("[ERROR] Permission for volume set is denied"); //LCOV_EXCL_LINE + //LCOV_EXCL_START + MA_SLOGE("[ERROR] Permission for volume set is denied"); g_volume_set_privilege_allowed = 0; __check_privilege_deinitialize(); return MA_ERROR_PERMISSION_DENIED; + //LCOV_EXCL_STOP } __check_privilege_deinitialize(); } @@ -427,6 +437,7 @@ static void delete_retry_connection_timer(void* data) } } +//LCOV_EXCL_START static void add_retry_connection_timer(void* data) { delete_retry_connection_timer(NULL); @@ -434,6 +445,7 @@ static void add_retry_connection_timer(void* data) g_retry_connection_timer = ecore_timer_add(1.5f, retry_connection, NULL); MA_SLOGI("Added timer for retry_connection : %p", g_retry_connection_timer); //LCOV_EXCL_LINE } +//LCOV_EXCL_STOP static void __start_prepare_func() { @@ -2115,6 +2127,7 @@ int ma_unset_audio_streaming_data_section_changed_cb(void) return MA_ERROR_NONE; } +//LCOV_EXCL_START int ma_set_preprocessing_result_received_cb(ma_preprocessing_result_received_cb callback, void* user_data) { if (0 != __ma_get_feature_enabled()) { @@ -2177,6 +2190,7 @@ int ma_set_assistant_language(const char* language) MA_SLOGD("[Manager] Set assistant language"); //LCOV_EXCL_LINE return ma_set_assistant_wakeup_language(language); } +//LCOV_EXCL_STOP int ma_set_assistant_wakeup_language(const char* language) { diff --git a/client/ma_ap.c b/client/ma_ap.c index 6c11150..7b3b9ae 100644 --- a/client/ma_ap.c +++ b/client/ma_ap.c @@ -42,13 +42,12 @@ static cynara *p_cynara = NULL; static void __ma_ap_notify_error(void* data); +//LCOV_EXCL_START static int __ma_ap_get_feature_enabled() { if (0 == g_feature_enabled) { - //LCOV_EXCL_START MAAP_SLOGE("[ERROR] Multi-assistant feature NOT supported"); return MA_ERROR_NOT_SUPPORTED; - //LCOV_EXCL_STOP } else if (-1 == g_feature_enabled) { bool ma_supported = false; bool mic_supported = false; @@ -124,10 +123,8 @@ static int __ma_ap_check_recorder_privilege() char uid[16]; if (0 == g_recorder_privilege_allowed) { - //LCOV_EXCL_START MAAP_SLOGE("[ERROR] Permission for recording is denied"); return MA_ERROR_PERMISSION_DENIED; - //LCOV_EXCL_STOP } else if (-1 == g_recorder_privilege_allowed) { if (false == __check_privilege_initialize()) { MAAP_SLOGE("[ERROR] privilege initialize is failed"); //LCOV_EXCL_LINE diff --git a/client/ma_ap_client.c b/client/ma_ap_client.c index f4dcf24..b8ff567 100644 --- a/client/ma_ap_client.c +++ b/client/ma_ap_client.c @@ -46,6 +46,7 @@ typedef struct { static GSList* g_ap_client_list = NULL; +//LCOV_EXCL_START static ma_ap_client_s* __ap_client_get(ma_h ma) { if (NULL == ma) { @@ -346,7 +347,6 @@ int ma_ap_client_get_audio_streaming_cb(ma_h ma, ma_audio_streaming_cb* callback return MA_ERROR_NONE; } -//LCOV_EXCL_STOP int ma_ap_client_set_audio_streaming_data_section_changed_cb(ma_h ma, ma_audio_streaming_data_section_changed_cb callback, void* user_data) { @@ -361,7 +361,6 @@ int ma_ap_client_set_audio_streaming_data_section_changed_cb(ma_h ma, ma_audio_s return MA_ERROR_NONE; } -//LCOV_EXCL_START int ma_ap_client_get_audio_streaming_data_section_changed_cb(ma_h ma, ma_audio_streaming_data_section_changed_cb* callback, void** user_data) { ma_ap_client_s* client = __ap_client_get(ma); @@ -374,3 +373,4 @@ int ma_ap_client_get_audio_streaming_data_section_changed_cb(ma_h ma, ma_audio_s return MA_ERROR_NONE; } +//LCOV_EXCL_STOP diff --git a/client/ma_ap_dbus.c b/client/ma_ap_dbus.c index c25d62a..3d1d7bb 100644 --- a/client/ma_ap_dbus.c +++ b/client/ma_ap_dbus.c @@ -52,6 +52,7 @@ typedef struct { static const char *message_port = "ma_streaming_port"; static int g_local_port_id = -1; +//LCOV_EXCL_START static void message_port_cb(int local_port_id, const char *remote_app_id, const char *remote_port, bool trusted_remote_port, bundle *message, void *user_data) @@ -170,4 +171,4 @@ int ma_ap_dbus_close_connection() g_streaming_requested = false; return streaming_ipc_deinitialize(); } - +//LCOV_EXCL_STOP