未验证 提交 83fee946 编写于 作者: O openharmony_ci 提交者: Gitee

!1789 seccomp测试用例提高接口覆盖率

Merge pull request !1789 from 夏不白/seccomp_coverage
...@@ -216,11 +216,11 @@ bool SetSeccompPolicyWithName(const char *filterName) ...@@ -216,11 +216,11 @@ bool SetSeccompPolicyWithName(const char *filterName)
} else { } else {
PLUGIN_LOGE("GetSeccompPolicy failed return is %d", retCode); PLUGIN_LOGE("GetSeccompPolicy failed return is %d", retCode);
} }
#ifndef COVERAGE_TEST
if (handler != NULL) { if (handler != NULL) {
dlclose(handler); dlclose(handler);
} }
#endif
if (filterLibRealPath != NULL) { if (filterLibRealPath != NULL) {
free(filterLibRealPath); free(filterLibRealPath);
} }
......
...@@ -322,10 +322,20 @@ ohos_unittest("init_unittest") { ...@@ -322,10 +322,20 @@ ohos_unittest("init_unittest") {
} }
if (defined(build_seccomp) && build_seccomp) { if (defined(build_seccomp) && build_seccomp) {
sources += [ "seccomp/seccomp_unittest.cpp" ] sources += [
"../../services/modules/seccomp/seccomp_policy.c",
"seccomp/seccomp_unittest.cpp",
]
include_dirs += include_dirs +=
[ "//base/startup/init/interfaces/innerkits/seccomp/include" ] [ "//base/startup/init/interfaces/innerkits/seccomp/include" ]
external_deps += [ "init:seccomp" ]
if (build_variant == "root") {
defines += [ "WITH_SECCOMP_DEBUG" ]
}
if (use_clang_coverage) {
defines += [ "COVERAGE_TEST" ]
}
} }
if (defined(build_selinux) && build_selinux) { if (defined(build_selinux) && build_selinux) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册