Added tc line coverage exception tag 21/134221/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 15 Jun 2017 08:56:27 +0000 (17:56 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 15 Jun 2017 09:44:20 +0000 (09:44 +0000)
Change-Id: I584b8f3591bf9fe4c9b9f9713adfee70c6b47248

src/list.h
src/tbm_bufmgr.c
src/tbm_surface_internal.c
src/tbm_sync.c

index aa2f5ed..1062241 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <stddef.h>
 
+/* LCOV_EXCL_START */
 static void list_inithead(struct list_head *item)
 {
        item->prev = item;
@@ -129,3 +130,4 @@ static inline void list_delinit(struct list_head *item)
                pos = container_of(pos->member.prev, pos, member))
 
 #endif /*_U_DOUBLE_LIST_H_*/
+/* LCOV_EXCL_STOP */
index bef7660..64b12f6 100644 (file)
@@ -106,6 +106,7 @@ _tbm_set_last_result(tbm_error_e err)
        tbm_last_error = err;
 }
 
+/* LCOV_EXCL_START */
 static bool
 _tbm_bufmgr_mutex_init(void)
 {
@@ -170,7 +171,6 @@ _tbm_flag_to_str(int f)
        return str;
 }
 
-/* LCOV_EXCL_START */
 static void
 _tbm_util_check_bo_cnt(tbm_bufmgr bufmgr)
 {
@@ -288,8 +288,10 @@ tbm_user_data
 
        user_data = calloc(1, sizeof(tbm_user_data));
        if (!user_data) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("fail to allocate an user_date\n");
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        user_data->key = key;
@@ -620,7 +622,6 @@ tbm_bufmgr_init(int fd)
        } else
                bTrace = 0;
 #endif
-       /* LCOV_EXCL_STOP */
 
        pthread_mutex_lock(&gLock);
 
@@ -629,6 +630,7 @@ tbm_bufmgr_init(int fd)
                TBM_LOG_W("!!!!!WARNING:: IT WILL BE CHANGED like tbm_bufmgr_init(int fd) --> tbm_bufmgr_init(void).\n");
        }
 
+
        /* initialize buffer manager */
        if (gBufMgr) {
                gBufMgr->ref_count++;
@@ -652,15 +654,15 @@ tbm_bufmgr_init(int fd)
 
        /* load bufmgr priv from env */
        if (!_tbm_load_module(gBufMgr, gBufMgr->fd)) {
-               /* LCOV_EXCL_START */
                _tbm_set_last_result(TBM_BO_ERROR_LOAD_MODULE_FAILED);
                TBM_LOG_E("error : Fail to load bufmgr backend\n");
                free(gBufMgr);
                gBufMgr = NULL;
                pthread_mutex_unlock(&gLock);
                return NULL;
-               /* LCOV_EXCL_STOP */
+
        }
+       /* LCOV_EXCL_STOP */
 
        /* log for tbm backend_flag */
        TBM_DBG("backend flag:%x:", gBufMgr->backend->flags);
@@ -869,11 +871,13 @@ tbm_bo_alloc(tbm_bufmgr bufmgr, int size, int flags)
 
        bo = calloc(1, sizeof(struct _tbm_bo));
        if (!bo) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to create of tbm_bo size(%d) flag(%s)\n",
                                size, _tbm_flag_to_str(flags));
                _tbm_set_last_result(TBM_BO_ERROR_HEAP_ALLOC_FAILED);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        _tbm_util_check_bo_cnt(bufmgr);
@@ -882,12 +886,14 @@ tbm_bo_alloc(tbm_bufmgr bufmgr, int size, int flags)
 
        bo_priv = bufmgr->backend->bo_alloc(bo, size, flags);
        if (!bo_priv) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to create of tbm_bo size(%d) flag(%s)\n",
                                size, _tbm_flag_to_str(flags));
                _tbm_set_last_result(TBM_BO_ERROR_BO_ALLOC_FAILED);
                free(bo);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        bufmgr->bo_cnt++;
@@ -920,28 +926,34 @@ tbm_bo_import(tbm_bufmgr bufmgr, unsigned int key)
        TBM_BUFMGR_RETURN_VAL_IF_FAIL(bufmgr == gBufMgr, NULL);
 
        if (!bufmgr->backend->bo_import) {
+               /* LCOV_EXCL_START */
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        _tbm_util_check_bo_cnt(bufmgr);
 
        bo = calloc(1, sizeof(struct _tbm_bo));
        if (!bo) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to import of tbm_bo by key(%d)\n", key);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        bo->bufmgr = bufmgr;
 
        bo_priv = bufmgr->backend->bo_import(bo, key);
        if (!bo_priv) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to import of tbm_bo by key(%d)\n", key);
                _tbm_set_last_result(TBM_BO_ERROR_IMPORT_FAILED);
                free(bo);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!LIST_IS_EMPTY(&bufmgr->bo_list)) {
@@ -994,28 +1006,34 @@ tbm_bo_import_fd(tbm_bufmgr bufmgr, tbm_fd fd)
        TBM_BUFMGR_RETURN_VAL_IF_FAIL(bufmgr == gBufMgr, NULL);
 
        if (!bufmgr->backend->bo_import_fd) {
+               /* LCOV_EXCL_START */
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        _tbm_util_check_bo_cnt(bufmgr);
 
        bo = calloc(1, sizeof(struct _tbm_bo));
        if (!bo) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to import tbm_bo by tbm_fd(%d)\n", fd);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        bo->bufmgr = bufmgr;
 
        bo_priv = bufmgr->backend->bo_import_fd(bo, fd);
        if (!bo_priv) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: fail to import tbm_bo by tbm_fd(%d)\n", fd);
                _tbm_set_last_result(TBM_BO_ERROR_IMPORT_FD_FAILED);
                free(bo);
                _tbm_bufmgr_mutex_unlock();
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!LIST_IS_EMPTY(&bufmgr->bo_list)) {
@@ -1068,16 +1086,20 @@ tbm_bo_export(tbm_bo bo)
        TBM_BUFMGR_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), 0);
 
        if (!bufmgr->backend->bo_export) {
+               /* LCOV_EXCL_START */
                _tbm_bufmgr_mutex_unlock();
                return 0;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = bufmgr->backend->bo_export(bo);
        if (!ret) {
+               /* LCOV_EXCL_START */
                _tbm_set_last_result(TBM_BO_ERROR_EXPORT_FAILED);
                TBM_LOG_E("error: bo(%p) tbm_key(%d)\n", bo, ret);
                _tbm_bufmgr_mutex_unlock();
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        TBM_TRACE("bo(%p) tbm_key(%u)\n", bo, ret);
@@ -1099,16 +1121,20 @@ tbm_bo_export_fd(tbm_bo bo)
        TBM_BUFMGR_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), -1);
 
        if (!bufmgr->backend->bo_export_fd) {
+               /* LCOV_EXCL_START */
                _tbm_bufmgr_mutex_unlock();
                return -1;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = bufmgr->backend->bo_export_fd(bo);
        if (ret < 0) {
+               /* LCOV_EXCL_START */
                _tbm_set_last_result(TBM_BO_ERROR_EXPORT_FD_FAILED);
                TBM_LOG_E("error: bo(%p) tbm_fd(%d)\n", bo, ret);
                _tbm_bufmgr_mutex_unlock();
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        TBM_TRACE("bo(%p) tbm_fd(%d)\n", bo, ret);
@@ -1131,10 +1157,12 @@ tbm_bo_get_handle(tbm_bo bo, int device)
 
        bo_handle = bufmgr->backend->bo_get_handle(bo, device);
        if (bo_handle.ptr == NULL) {
+               /* LCOV_EXCL_START */
                _tbm_set_last_result(TBM_BO_ERROR_GET_HANDLE_FAILED);
                TBM_LOG_E("error: bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
                _tbm_bufmgr_mutex_unlock();
                return (tbm_bo_handle) NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        TBM_TRACE("bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
@@ -1164,11 +1192,13 @@ tbm_bo_map(tbm_bo bo, int device, int opt)
 
        bo_handle = bufmgr->backend->bo_map(bo, device, opt);
        if (bo_handle.ptr == NULL) {
+               /* LCOV_EXCL_START */
                _tbm_set_last_result(TBM_BO_ERROR_MAP_FAILED);
                TBM_LOG_E("error: fail to map bo:%p\n", bo);
                _tbm_bo_unlock(bo);
                _tbm_bufmgr_mutex_unlock();
                return (tbm_bo_handle) NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        /* increase the map_count */
@@ -1194,10 +1224,12 @@ tbm_bo_unmap(tbm_bo bo)
 
        ret = bufmgr->backend->bo_unmap(bo);
        if (!ret) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("error: bo(%p) map_cnt(%d)\n", bo, bo->map_cnt);
                _tbm_set_last_result(TBM_BO_ERROR_UNMAP_FAILED);
                _tbm_bufmgr_mutex_unlock();
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        /* decrease the map_count */
@@ -1711,7 +1743,6 @@ tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay)
 
        return 1;
 }
-/* LCOV_EXCL_STOP */
 
 int tbm_bufmgr_get_fd_limit(void)
 {
@@ -1722,4 +1753,4 @@ int tbm_bufmgr_get_fd_limit(void)
 
        return (int)lim.rlim_cur;
 }
-
+/* LCOV_EXCL_STOP */
index fd375a9..afcf94f 100644 (file)
@@ -69,7 +69,6 @@ void _tbm_surface_mutex_unlock(void);
 }
 
 /* LCOV_EXCL_START */
-
 static double
 _tbm_surface_internal_get_time(void)
 {
@@ -218,7 +217,6 @@ _tbm_surface_internal_format_to_str(tbm_format format)
                return "unknwon";
        }
 }
-/* LCOV_EXCL_STOP */
 
 static bool
 _tbm_surface_mutex_init(void)
@@ -270,6 +268,7 @@ _deinit_surface_bufmgr(void)
        tbm_bufmgr_deinit(g_surface_bufmgr);
        g_surface_bufmgr = NULL;
 }
+/* LCOV_EXCL_STOP */
 
 static int
 _tbm_surface_internal_is_valid(tbm_surface_h surface)
@@ -315,8 +314,10 @@ _tbm_surface_internal_query_plane_data(tbm_surface_h surface,
        ret = mgr->backend->surface_get_plane_data(surf->info.width,
                        surf->info.height, surf->info.format, plane_idx, size, offset, pitch, bo_idx);
        if (!ret) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("Fail to surface_get_plane_data. surface(%p)\n", surface);
                return 0;
+               /* LCOV_EXCL_STOP */
        }
 
        return 1;
@@ -411,8 +412,10 @@ tbm_surface_internal_query_supported_formats(uint32_t **formats,
 
        ret = mgr->backend->surface_supported_format(formats, num);
        if (!ret)  {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("Fail to surface_supported_format.\n");
                goto fail;
+               /* LCOV_EXCL_START */
        }
 
        TBM_TRACE("tbm_bufmgr(%p) format num(%u)\n", g_surface_bufmgr, *num);
@@ -421,6 +424,7 @@ tbm_surface_internal_query_supported_formats(uint32_t **formats,
 
        return ret;
 
+/* LCOV_EXCL_START */
 fail:
        if (bufmgr_initialized) {
                LIST_DELINIT(&g_surface_bufmgr->surf_list);
@@ -431,6 +435,7 @@ fail:
        TBM_LOG_E("error: tbm_bufmgr(%p)\n", g_surface_bufmgr);
 
        return 0;
+/* LCOV_EXCL_STOP */
 }
 
 int
@@ -642,8 +647,10 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
        surf = calloc(1, sizeof(struct _tbm_surface));
        if (!surf) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("fail to alloc surf\n");
                goto alloc_surf_fail;
+               /* LCOV_EXCL_STOP */
        }
 
        surf->bufmgr = mgr;
@@ -744,6 +751,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
        return surf;
 
+/* LCOV_EXCL_START */
 alloc_bo_fail:
        for (j = 0; j < i; j++) {
                if (surf->bos[j])
@@ -762,6 +770,7 @@ check_valid_fail:
        TBM_LOG_E("error: width(%d) height(%d) format(%s) flags(%d)\n",
                        width, height,
                        _tbm_surface_internal_format_to_str(format), flags);
+/* LCOV_EXCL_STOP */
 
        return NULL;
 }
@@ -795,8 +804,10 @@ tbm_surface_internal_create_with_bos(tbm_surface_info_s *info,
 
        surf = calloc(1, sizeof(struct _tbm_surface));
        if (!surf) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("fail to allocate struct _tbm_surface.\n");
                goto alloc_surf_fail;
+               /* LCOV_EXCL_STOP */
        }
 
        surf->bufmgr = mgr;
@@ -865,6 +876,7 @@ tbm_surface_internal_create_with_bos(tbm_surface_info_s *info,
 
        return surf;
 
+/* LCOV_EXCL_START */
 check_bo_fail:
        for (i = 0; i < num; i++) {
                if (surf->bos[i])
@@ -882,6 +894,7 @@ check_valid_fail:
        TBM_LOG_E("error: width(%u) height(%u) format(%s) bo_num(%d)\n",
                        info->width, info->height,
                        _tbm_surface_internal_format_to_str(info->format), num);
+/* LCOV_EXCL_STOP */
 
        return NULL;
 }
index 9ebca2e..9ee38a0 100644 (file)
@@ -70,6 +70,7 @@ struct sync_merge_data {
 
 #define ERRNO_BUF_SIZE 256
 
+/* LCOV_EXCL_START */
 static inline void
 _log_errno()
 {
@@ -182,3 +183,4 @@ tbm_sync_fence_merge(const char *name, tbm_fd fence1, tbm_fd fence2)
 
        return data.fence;
 }
+/* LCOV_EXCL_STOP */