tbm_module: check coverage with the TBM_MODULE_TYPE_HAL_TBM 94/259894/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 15 Jun 2021 05:42:31 +0000 (14:42 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 15 Jun 2021 12:03:10 +0000 (21:03 +0900)
We do not check coverage with old module type.

Change-Id: If62e1a813a5117f0d3fcd0e60d84f67334b1e40c

src/tbm_module.c

index 0ba5dc0..96beb2f 100644 (file)
@@ -52,7 +52,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define GET_MODULE_PATCHLEVEL(vers)    ((vers) & 0xFFFF)
 
 /* LCOV_EXCL_START */
-
 static int
 _tbm_backend_load_hal_tbm(tbm_module *module)
 {
@@ -341,7 +340,6 @@ err:
        dlclose(module_data);
        return 0;
 }
-
 /* LCOV_EXCL_STOP */
 
 tbm_module *
@@ -364,6 +362,7 @@ tbm_module_load(int fd)
                goto done;
        }
 
+/* LCOV_EXCL_START */
        /* try to load the new backend module */
        ret = _tbm_backend_load_module(module, DEFAULT_LIB);
        if (ret) {
@@ -410,6 +409,7 @@ tbm_module_load(int fd)
                free(module);
                module = NULL;
        }
+/* LCOV_EXCL_STOP */
 
 done:
        return module;
@@ -432,6 +432,7 @@ tbm_module_unload(tbm_module *module)
                module->hal_bufmgr = NULL;
                module->use_hal_tbm = 0;
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                module->backend_module_data->deinit(module->bufmgr_data);
                module->bo_func = NULL;
@@ -452,6 +453,7 @@ tbm_module_unload(tbm_module *module)
        default:
                TBM_ERR("Wrong module type:%d", module->type);
                break;
+/* LCOV_EXCL_STOP */
        }
 
        free(module);
@@ -469,6 +471,7 @@ tbm_module_bufmgr_get_capabilities(tbm_module *module, tbm_error_e *error)
        case TBM_MODULE_TYPE_HAL_TBM:
                capabilities = hal_tbm_bufmgr_get_capabilities(module->hal_bufmgr, (hal_tbm_error *)error);
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                bufmgr_func = module->bufmgr_func;
                TBM_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr_func, 0, *error, TBM_ERROR_INVALID_OPERATION);
@@ -486,6 +489,7 @@ tbm_module_bufmgr_get_capabilities(tbm_module *module, tbm_error_e *error)
                TBM_ERR("Wrong module type:%d", module->type);
                *error = TBM_ERROR_INVALID_OPERATION;
                break;
+/* LCOV_EXCL_STOP */
        }
 
        return capabilities;
@@ -525,6 +529,7 @@ tbm_module_bufmgr_bind_native_display(tbm_module *module, void *native_display)
                        error = TBM_ERROR_NONE;
                }
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                bufmgr_func = module->bufmgr_func;
                TBM_RETURN_VAL_IF_FAIL(bufmgr_func, TBM_ERROR_INVALID_OPERATION);
@@ -547,6 +552,7 @@ tbm_module_bufmgr_bind_native_display(tbm_module *module, void *native_display)
                TBM_ERR("Wrong module type:%d", module->type);
                error = TBM_ERROR_INVALID_OPERATION;
                break;
+/* LCOV_EXCL_STOP */
        }
 
        return error;
@@ -566,6 +572,7 @@ tbm_module_bufmgr_get_supported_formats(tbm_module *module, uint32_t **formats,
        case TBM_MODULE_TYPE_HAL_TBM:
                error = (tbm_error_e)hal_tbm_bufmgr_get_supported_formats(module->hal_bufmgr, formats, num);
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                bufmgr_func = module->bufmgr_func;
                TBM_RETURN_VAL_IF_FAIL(bufmgr_func, TBM_ERROR_INVALID_OPERATION);
@@ -588,6 +595,7 @@ tbm_module_bufmgr_get_supported_formats(tbm_module *module, uint32_t **formats,
                TBM_ERR("Wrong module type:%d", module->type);
                error = TBM_ERROR_INVALID_OPERATION;
                break;
+/* LCOV_EXCL_STOP */
        }
 
        return error;
@@ -606,6 +614,7 @@ tbm_module_bufmgr_bo_alloc(tbm_module *module, tbm_bo bo, int size, int flags, t
        case TBM_MODULE_TYPE_HAL_TBM:
                bo_data = (tbm_backend_bo_data *)hal_tbm_bufmgr_alloc_bo(module->hal_bufmgr, size, flags, (hal_tbm_error *)error);
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                bufmgr_func = module->bufmgr_func;
                TBM_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr_func, NULL, *error, TBM_ERROR_INVALID_OPERATION);
@@ -626,6 +635,7 @@ tbm_module_bufmgr_bo_alloc(tbm_module *module, tbm_bo bo, int size, int flags, t
                TBM_ERR("Wrong module type:%d", module->type);
                *error = TBM_ERROR_INVALID_OPERATION;
                break;
+/* LCOV_EXCL_STOP */
        }
 
        return bo_data;
@@ -646,6 +656,7 @@ tbm_module_bufmgr_bo_alloc_with_format(tbm_module *module, int format, int bo_id
                                                                                        format, bo_idx, width, height, bpp,
                                                                                        (hal_tbm_bo_memory_type)flags, (hal_tbm_error *)error);
                break;
+/* LCOV_EXCL_START */
        case TBM_MODULE_TYPE_TBM_BACKEND:
                bufmgr_func = module->bufmgr_func;
                TBM_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr_func, NULL, *error, TBM_ERROR_INVALID_OPERATION);
@@ -663,6 +674,7 @@ tbm_module_bufmgr_bo_alloc_with_format(tbm_module *module, int format, int bo_id
                TBM_ERR("Wrong module type:%d", module->type);
                *error = TBM_ERROR_INVALID_OPERATION;
                break;
+/* LCOV_EXCL_STOP */
        }
 
        return bo_data;