From: Sangchul Lee Date: Thu, 19 May 2022 05:26:34 +0000 (+0900) Subject: Add more macro to exclude lines from coverage measurement X-Git-Tag: submit/tizen/20220524.054919~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f94b615b4acc509a03de0e6c49836b7b22ac361c;p=platform%2Fcore%2Fapi%2Fwebrtc.git Add more macro to exclude lines from coverage measurement [Version] 0.3.106 [Issue Type] Line coverage Change-Id: Ibf9f09f635bb9a6268734138f7be80787d9213b0 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index ac9c963d..aa17c6c2 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.3.105 +Version: 0.3.106 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_private.c b/src/webrtc_private.c index 300b0a95..7081997e 100644 --- a/src/webrtc_private.c +++ b/src/webrtc_private.c @@ -121,7 +121,6 @@ static const char *__get_error_string(webrtc_error_e error) return "(invalid error)"; } } -//LCOV_EXCL_STOP void _generate_dot(GstElement *pipeline, const gchar *name) { @@ -138,6 +137,7 @@ void _generate_dot(GstElement *pipeline, const gchar *name) g_free(dot_name); } +//LCOV_EXCL_STOP /* Use g_free() to release the return value. */ static gchar* __get_string_from_json_object(JsonObject *object) @@ -2220,6 +2220,7 @@ int _apply_stream_info(GstElement *element, const char *stream_type, int stream_ return WEBRTC_ERROR_NONE; } +//LCOV_EXCL_START int _set_packet_drop_probability(webrtc_s *webrtc, bool sender, float probability) { const char *prop_name = sender ? "drop-probability-sender" : "drop-probability-receiver"; @@ -2250,3 +2251,4 @@ int _get_packet_drop_probability(webrtc_s *webrtc, bool sender, float *probabili return WEBRTC_ERROR_NONE; } +//LCOV_EXCL_STOP \ No newline at end of file diff --git a/src/webrtc_resource.c b/src/webrtc_resource.c index 596e4a32..7253db45 100644 --- a/src/webrtc_resource.c +++ b/src/webrtc_resource.c @@ -72,8 +72,10 @@ int _create_resource_manager(webrtc_s *webrtc) if (mm_resource_manager_create(MM_RESOURCE_MANAGER_APP_CLASS_MEDIA, __resource_release_cb, webrtc, &webrtc->resource.mgr) != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to init resource manager for media"); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } return WEBRTC_ERROR_NONE; @@ -90,23 +92,29 @@ int _acquire_resource_for_type(webrtc_s *webrtc, mm_resource_manager_res_type_e return WEBRTC_ERROR_NONE; if (webrtc->resource.res[type] != NULL) { +//LCOV_EXCL_START LOG_ERROR("type[%d] resource was already acquired", type); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } LOG_DEBUG("mark for acquire type[%d] resource", type); ret = mm_resource_manager_mark_for_acquire(webrtc->resource.mgr, type, MM_RESOURCE_MANAGER_RES_VOLUME_FULL, &webrtc->resource.res[type]); if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to mark resource for acquire, ret[0x%x]", ret); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } LOG_DEBUG("commit type[%d] resource", type); ret = mm_resource_manager_commit(webrtc->resource.mgr); if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to commit of resource, ret([0x%x]", ret); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } return WEBRTC_ERROR_NONE; @@ -123,19 +131,25 @@ int _release_all_resources(webrtc_s *webrtc) return WEBRTC_ERROR_NONE; if (webrtc->resource.release_cb_is_calling) { +//LCOV_EXCL_START LOG_INFO("__resource_release_cb is calling, so skip"); return WEBRTC_ERROR_NONE; +//LCOV_EXCL_STOP } ret = mm_resource_manager_mark_all_for_release(webrtc->resource.mgr); if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to mark all for release, ret[0x%x]", ret); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } ret = mm_resource_manager_commit(webrtc->resource.mgr); if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to commit resource, ret[0x%x]", ret); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } LOG_DEBUG("all resources were released by resource manager"); @@ -158,8 +172,10 @@ int _destroy_resource_manager(webrtc_s *webrtc) ret = mm_resource_manager_destroy(webrtc->resource.mgr); if (ret != MM_RESOURCE_MANAGER_ERROR_NONE) { +//LCOV_EXCL_START LOG_ERROR("failed to destroy resource manager, ret[0x%x]", ret); return WEBRTC_ERROR_RESOURCE_FAILED; +//LCOV_EXCL_STOP } webrtc->resource.mgr = NULL; LOG_DEBUG("destroyed resource manager"); diff --git a/src/webrtc_source.c b/src/webrtc_source.c index f4318642..74445951 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -665,6 +665,7 @@ static bool __is_hw_encoder_used(webrtc_s *webrtc, webrtc_media_source_type_e so return false; } +//LCOV_EXCL_START static GstElement *__get_hw_encoder_element(webrtc_s *webrtc, webrtc_gst_slot_s *source) { const ini_item_media_source_s *ini_source; @@ -704,6 +705,7 @@ static GstElement *__get_hw_encoder_element(webrtc_s *webrtc, webrtc_gst_slot_s LOG_DEBUG("no hw encoder is requested, source_type(%d), media_types(0x%x)", source->type, source->media_types); return NULL; } +//LCOV_EXCL_STOP static bool __is_encoded_format_supported(webrtc_media_source_type_e type, webrtc_ini_s *ini) { @@ -1164,6 +1166,7 @@ static void __remove_probe_from_pad_for_pause(webrtc_gst_slot_s *source, unsigne source->av[idx].src_pad = NULL; } +//LCOV_EXCL_START static bool __remove_elements_from_bin(GstBin *bin, GList *element_list) { GstElement *element; @@ -1184,6 +1187,7 @@ static bool __remove_elements_from_bin(GstBin *bin, GList *element_list) return true; } +//LCOV_EXCL_STOP static void __foreach_unref_object_cb(gpointer data, gpointer user_data) {