Add more macro to exclude lines from coverage measurement 51/275251/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 19 May 2022 05:26:34 +0000 (14:26 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 19 May 2022 05:26:34 +0000 (14:26 +0900)
[Version] 0.3.106
[Issue Type] Line coverage

Change-Id: Ibf9f09f635bb9a6268734138f7be80787d9213b0
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_private.c
src/webrtc_resource.c
src/webrtc_source.c

index ac9c963d670e3ed2cac23a567c73eba83765b645..aa17c6c260dd1201ff89d552db634d853a9f965f 100644 (file)
@@ -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
index 300b0a95887830ba7723486a0fb5d3af4212bda5..7081997e2f20e9c8d9abd455d012329e37ffc250 100644 (file)
@@ -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
index 596e4a32e9849667ef9cd48409a203628eba3a3f..7253db4563a31bcc529a12d12a6b7ceaef0d79b1 100644 (file)
@@ -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");
index f4318642ab9f254dbcbe3130546bdb69adf1c7e8..7444595184bf7f7cb84f8db77986f1e0756873c1 100644 (file)
@@ -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)
 {