From b6a8188b393168476c5517cd1705cedb845e79b4 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Thu, 19 May 2022 16:00:14 +0900 Subject: [PATCH] Add comments for line coverage test - Code which could not be tested by TCT - Code for error handling [Version] 0.4.78-2 [Issue Type] Line coverage Change-Id: I292e0940240ea8af0bac1e346cdf93508a0560e0 Signed-off-by: Jeongmo Yang --- packaging/capi-media-camera.spec | 2 +- src/camera.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 22c23e6..361dbe5 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,7 +1,7 @@ Name: capi-media-camera Summary: A Camera API Version: 0.4.78 -Release: 1 +Release: 2 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/camera.c b/src/camera.c index 2ac7a71..919b526 100644 --- a/src/camera.c +++ b/src/camera.c @@ -62,6 +62,7 @@ static bool __create_msg_handler_thread(camera_msg_handler_info_s *handler_info, static void __destroy_msg_handler_thread(camera_msg_handler_info_s *handler_info); +//LCOV_EXCL_START static gboolean __camera_allocate_preview_buffer(camera_h camera) { int i = 0; @@ -176,7 +177,7 @@ static void __camera_release_preview_buffer(camera_h camera) CAM_LOG_INFO("Done"); } - +//LCOV_EXCL_STOP static void __camera_release_tfd(int tfd[MUSE_NUM_FD]) { @@ -415,6 +416,7 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv } } +//LCOV_EXCL_START /* 3. media bridge */ g_mutex_lock(&cb_info->bridge_lock); @@ -426,6 +428,7 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv media_packet_unref(pkt); } } +//LCOV_EXCL_STOP g_mutex_unlock(&cb_info->bridge_lock); @@ -519,6 +522,7 @@ static void __camera_event_handler_capture(camera_cb_info_s *cb_info, char *recv CAM_LOG_INFO("image info %dx%d, size %d, EXIF info %p, size %d", rImage->width, rImage->height, rImage->size, rImage->exif, rImage->exif_size); +//LCOV_EXCL_START if (CAMERA_IS_FD_VALID(capture_fd_post)) { /* import tbm bo and get virtual address */ tfd_index++; @@ -544,6 +548,7 @@ static void __camera_event_handler_capture(camera_cb_info_s *cb_info, char *recv CAM_LOG_ERROR("failed to import fd [%d] for thumbnail", tfd[tfd_index]); } } +//LCOV_EXCL_STOP ((camera_capturing_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE])(rImage, rPostview, rThumbnail, cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE]); @@ -571,6 +576,7 @@ _CAPTURE_CB_HANDLER_DONE: } +//LCOV_EXCL_START static void __camera_event_handler_face_detection(camera_cb_info_s *cb_info, char *recv_msg, int *tfd) { int count = 0; @@ -614,6 +620,7 @@ static void __camera_event_handler_face_detection(camera_cb_info_s *cb_info, cha /* return buffer */ _camera_msg_return_buffer(face_fd, cb_info); } +//LCOV_EXCL_STOP static bool __camera_import_tbm_fd(tbm_bufmgr bufmgr, int fd, tbm_bo *bo, tbm_bo_handle *bo_handle) @@ -2033,6 +2040,7 @@ static gpointer __camera_msg_recv_func(gpointer data) CAM_LOG_INFO("client cb exit - server connected %d", cb_info->is_server_connected); +//LCOV_EXCL_START if (!cb_info->is_server_connected) { char *error_msg = NULL; @@ -2069,6 +2077,7 @@ static gpointer __camera_msg_recv_func(gpointer data) CAM_LOG_ERROR("add error msg for service disconnection done"); } +//LCOV_EXCL_STOP return NULL; } @@ -6869,6 +6878,7 @@ _DONE: } +//LCOV_EXCL_START int camera_media_bridge_set_bridge(camera_h camera, media_bridge_h bridge) { int ret = CAMERA_ERROR_NONE; @@ -6939,6 +6949,7 @@ _UNSET_MEDIA_BRIDGE_DONE: return ret; } +//LCOV_EXCL_STOP int _camera_get_log_level(void) -- 2.7.4