Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
36c724e1
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
36c724e1
编写于
1月 03, 2023
作者:
D
dhy308
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix review problems
Signed-off-by:
N
dhy308
<
tony.gan@huawei.com
>
上级
75710600
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
81 addition
and
235 deletion
+81
-235
libc-test/src/functional/pthread_getname_np.c
libc-test/src/functional/pthread_getname_np.c
+1
-1
libc-test/src/functionalext/fortify/poll.c
libc-test/src/functionalext/fortify/poll.c
+2
-2
libc-test/src/functionalext/info/fatal_message.c
libc-test/src/functionalext/info/fatal_message.c
+0
-1
libc-test/src/functionalext/sched/sched_setparam.c
libc-test/src/functionalext/sched/sched_setparam.c
+1
-1
libc-test/src/functionalext/supplement/linux/clone.c
libc-test/src/functionalext/supplement/linux/clone.c
+1
-1
libc-test/src/functionalext/supplement/passwd/getspnam_r.c
libc-test/src/functionalext/supplement/passwd/getspnam_r.c
+6
-0
libc-test/src/functionalext/unittest/BUILD.gn
libc-test/src/functionalext/unittest/BUILD.gn
+0
-27
libc-test/src/functionalext/unittest/unit_test_hook_preinit.c
...-test/src/functionalext/unittest/unit_test_hook_preinit.c
+0
-117
libc-test/src/functionalext/unittest/unit_test_ldso_dynlink.c
...-test/src/functionalext/unittest/unit_test_ldso_dynlink.c
+12
-12
libc-test/src/functionalext/unittest/unit_test_ldso_ld_log.c
libc-test/src/functionalext/unittest/unit_test_ldso_ld_log.c
+2
-2
libc-test/src/functionalext/unittest/unit_test_ldso_namespace.c
...est/src/functionalext/unittest/unit_test_ldso_namespace.c
+40
-40
libc-test/src/functionalext/unittest/unit_test_ldso_ns_config.c
...est/src/functionalext/unittest/unit_test_ldso_ns_config.c
+10
-10
musl_config.gni
musl_config.gni
+0
-5
musl_template.gni
musl_template.gni
+0
-4
porting/linux/user/src/hook/musl_preinit.c
porting/linux/user/src/hook/musl_preinit.c
+6
-12
未找到文件。
libc-test/src/functional/pthread_getname_np.c
浏览文件 @
36c724e1
...
...
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
char
set_thread_name
[]
=
"THREADFOO"
;
char
default_name
[]
=
"pthread_getname"
;
rc
=
pthread_getname_np
(
pthread_self
(),
thread_name
,
0
);
rc
=
pthread_getname_np
(
pthread_self
(),
thread_name
,
NAMELEN
-
1
);
if
(
rc
!=
ERANGE
)
errExitEN
(
rc
,
"pthread_getname_np(invalid args[len]) failed"
);
rc
=
pthread_getname_np
(
pthread_self
(),
thread_name
,
NAMELEN
);
...
...
libc-test/src/functionalext/fortify/poll.c
浏览文件 @
36c724e1
...
...
@@ -75,7 +75,7 @@ static void poll_0020(void)
/**
* @tc.name : poll_0030
* @tc.desc : test poll with
two fds and param count is 1
* @tc.desc : test poll with
buf's size greater than fd_count, return fd_count
* @tc.level : Level 1
*/
static
void
poll_0030
(
void
)
...
...
@@ -143,7 +143,7 @@ static void ppoll_0020(void)
/**
* @tc.name : ppoll_0030
* @tc.desc : test p
poll with two fds and param count is 1
* @tc.desc : test p
oll with buf's size greater than fd_count, return fd_count
* @tc.level : Level 1
*/
static
void
ppoll_0030
(
void
)
...
...
libc-test/src/functionalext/info/fatal_message.c
浏览文件 @
36c724e1
...
...
@@ -232,7 +232,6 @@ static void fatal_message_0060(void)
const
char
*
msg
=
NULL
;
fatal_msg_t
*
fatal_message
=
NULL
;
int
pidParent
=
0
;
int
pidChild
=
0
;
pid_t
fpid
;
...
...
libc-test/src/functionalext/sched/sched_setparam.c
浏览文件 @
36c724e1
...
...
@@ -24,7 +24,7 @@ typedef void (*TEST_FUN)(void);
/**
* @tc.name : sched_setparam
* @tc.desc :
Test the function of
sched_setparam.
* @tc.desc :
When param is NULL, call
sched_setparam.
* @tc.level : Level 2
*/
static
void
sched_setparam_0010
(
void
)
...
...
libc-test/src/functionalext/supplement/linux/clone.c
浏览文件 @
36c724e1
...
...
@@ -51,7 +51,7 @@ void clone_0200(void)
int
cpid
=
-
1
;
cpid
=
clone
((
int
(
*
)(
void
*
))
test
,
(
char
*
)
stack
+
STACK_SIZE
,
0
,
NULL
);
sleep
(
1
);
EXPECT_NE
(
"clone_0
1
00"
,
cpid
,
-
1
);
EXPECT_NE
(
"clone_0
2
00"
,
cpid
,
-
1
);
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
libc-test/src/functionalext/supplement/passwd/getspnam_r.c
浏览文件 @
36c724e1
...
...
@@ -37,6 +37,12 @@ void getspnam_r_0100(void)
if
(
result
!=
0
)
{
t_error
(
"%s getgrnam_r failed
\n
"
,
__func__
);
}
if
(
!
spwd
)
{
t_error
(
"%s failed, spwd is NULL
\n
"
,
__func__
);
}
if
(
strcmp
(
spwd_name
,
spwd
->
sp_namp
))
{
t_error
(
"%s spwd->sp_namp is %s
\n
"
,
__func__
,
spwd
->
sp_namp
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
libc-test/src/functionalext/unittest/BUILD.gn
浏览文件 @
36c724e1
...
...
@@ -146,38 +146,11 @@ ohos_executable("unittest_hilog_vsnprint") {
libs = [ "${musl_lib_dir}/libc.a" ]
}
ohos_executable("unittest_hook_preinit") {
subsystem_name = "musl"
part_name = "libc-test"
sources = [ "unit_test_hook_preinit.c" ]
include_dirs = [
"${musl_src_base}/src/hook",
"//${test_dir}/src/common",
"//${test_dir}/src/functionalext/common",
"${musl_src_base}/src/include",
"${musl_src_base}/include",
"${musl_src_base}/src/internal",
]
configs = [ "//third_party/musl/libc-test/src/common:config_unittest" ]
deps = [ "//third_party/musl:create_porting_src" ]
if (musl_unit_test_flag) {
defines = [ "UNIT_TEST_STATIC" ]
}
libs = [ "${musl_lib_dir}/libc.a" ]
}
group("functionalext_unittest_test") {
testonly = true
deps = [
":unittest_hilog_adapter",
":unittest_hilog_vsnprint",
":unittest_hook_preinit",
":unittest_ldso_dynlink",
":unittest_ldso_ld_log",
":unittest_ldso_namesapce",
...
...
libc-test/src/functionalext/unittest/unit_test_hook_preinit.c
已删除
100644 → 0
浏览文件 @
75710600
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "test.h"
#include "functionalext.h"
typedef
void
(
*
TEST_FUN
)(
void
);
#ifdef UNIT_TEST_STATIC
enum
EnumHookMode
;
int
parse_hook_variable
(
enum
EnumHookMode
*
mode
,
char
*
path
,
int
size
);
/**
* @tc.name : preinit_test_0010
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0010
(
void
)
{
int
ret
=
parse_hook_variable
(
NULL
,
NULL
,
0
);
EXPECT_EQ
(
preinit_test_0010
,
ret
,
-
1
);
}
bool
get_proc_name
(
pid_t
pid
,
char
*
buf
,
unsigned
int
buf_len
);
/**
* @tc.name : preinit_test_0020
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0020
(
void
)
{
int
ret
=
get_proc_name
(
0
,
NULL
,
0
);
EXPECT_EQ
(
preinit_test_0020
,
ret
,
false
);
}
void
clear_function_table
();
/**
* @tc.name : preinit_test_0030
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0030
(
void
)
{
clear_function_table
();
EXPECT_TRUE
(
preinit_test_0030
,
true
);
}
void
get_memleak_hook_param
();
/**
* @tc.name : preinit_test_0040
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0040
(
void
)
{
get_memleak_hook_param
();
EXPECT_TRUE
(
preinit_test_0040
,
true
);
}
void
__restore_hook_function_table
();
/**
* @tc.name : preinit_test_0050
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0050
(
void
)
{
__restore_hook_function_table
();
EXPECT_TRUE
(
preinit_test_0050
,
true
);
}
void
__install_malloc_hook
();
/**
* @tc.name : preinit_test_0060
* @tc.desc : test
* @tc.level : Level 2
*/
static
void
preinit_test_0060
(
void
)
{
__install_malloc_hook
();
EXPECT_TRUE
(
preinit_test_0060
,
true
);
}
#endif
TEST_FUN
G_Fun_Array
[]
=
{
#ifdef UNIT_TEST_STATIC
preinit_test_0010
,
preinit_test_0020
,
preinit_test_0030
,
preinit_test_0040
,
preinit_test_0050
,
preinit_test_0060
,
#endif
};
int
main
(
void
)
{
int
num
=
sizeof
(
G_Fun_Array
)
/
sizeof
(
TEST_FUN
);
for
(
int
pos
=
0
;
pos
<
num
;
++
pos
)
{
G_Fun_Array
[
pos
]();
}
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/unittest/unit_test_ldso_dynlink.c
浏览文件 @
36c724e1
...
...
@@ -22,7 +22,7 @@ typedef void (*TEST_FUN)(void);
/**
* @tc.name : dynlink_test_0010
* @tc.desc :
dlns_set_namespace_lib_path test
* @tc.desc :
Test dlns_set_namespace_lib_path with invalid input
* @tc.level : Level 2
*/
static
void
dynlink_test_0010
(
void
)
...
...
@@ -33,7 +33,7 @@ static void dynlink_test_0010(void)
/**
* @tc.name : dynlink_test_0020
* @tc.desc :
dlns_set_namespace_lib_path test
* @tc.desc :
Test dlns_set_namespace_lib_path with invalid input
* @tc.level : Level 2
*/
static
void
dynlink_test_0020
(
void
)
...
...
@@ -44,7 +44,7 @@ static void dynlink_test_0020(void)
/**
* @tc.name : dynlink_test_0030
* @tc.desc :
dlns_set_namespace_lib_path test
* @tc.desc :
Set path for default lib use dlns_set_namespace_lib_path
* @tc.level : Level 1
*/
static
void
dynlink_test_0030
(
void
)
...
...
@@ -55,7 +55,7 @@ static void dynlink_test_0030(void)
/**
* @tc.name : dynlink_test_0040
* @tc.desc :
dlns_set_namespace_separated tes
t
* @tc.desc :
Test dlns_set_namespace_separated with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0040
(
void
)
...
...
@@ -66,7 +66,7 @@ static void dynlink_test_0040(void)
/**
* @tc.name : dynlink_test_0050
* @tc.desc :
dlns_set_namespace_separated tes
t
* @tc.desc :
Test dlns_set_namespace_separated with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0050
(
void
)
...
...
@@ -77,7 +77,7 @@ static void dynlink_test_0050(void)
/**
* @tc.name : dynlink_test_0060
* @tc.desc :
dlns_set_namespace_separated test
* @tc.desc :
Set separated for default lib use dlns_set_namespace_separated
* @tc.level : Level 0
*/
static
void
dynlink_test_0060
(
void
)
...
...
@@ -88,7 +88,7 @@ static void dynlink_test_0060(void)
/**
* @tc.name : dynlink_test_0070
* @tc.desc :
dlns_set_namespace_permitted_paths tes
t
* @tc.desc :
Test dlns_set_namespace_permitted_paths with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0070
(
void
)
...
...
@@ -99,7 +99,7 @@ static void dynlink_test_0070(void)
/**
* @tc.name : dynlink_test_0080
* @tc.desc :
dlns_set_namespace_permitted_paths tes
t
* @tc.desc :
Test dlns_set_namespace_permitted_paths with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0080
(
void
)
...
...
@@ -110,7 +110,7 @@ static void dynlink_test_0080(void)
/**
* @tc.name : dynlink_test_0090
* @tc.desc :
dlns_set_namespace_permitted_paths test
* @tc.desc :
Set path for default lib use dlns_set_namespace_permitted_paths
* @tc.level : Level 0
*/
static
void
dynlink_test_0090
(
void
)
...
...
@@ -121,7 +121,7 @@ static void dynlink_test_0090(void)
/**
* @tc.name : dynlink_test_0100
* @tc.desc :
dlns_set_namespace_allowed_libs tes
t
* @tc.desc :
Test dlns_set_namespace_allowed_libs with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0100
(
void
)
...
...
@@ -132,7 +132,7 @@ static void dynlink_test_0100(void)
/**
* @tc.name : dynlink_test_0110
* @tc.desc :
dlns_set_namespace_allowed_libs tes
t
* @tc.desc :
Test dlns_set_namespace_allowed_libs with invalid inpu
t
* @tc.level : Level 2
*/
static
void
dynlink_test_0110
(
void
)
...
...
@@ -143,7 +143,7 @@ static void dynlink_test_0110(void)
/**
* @tc.name : dynlink_test_0120
* @tc.desc :
dlns_set_namespace_allowed_libs test
* @tc.desc :
Set allowed libs for default lib use dlns_set_namespace_allowed_libs
* @tc.level : Level 0
*/
static
void
dynlink_test_0120
(
void
)
...
...
libc-test/src/functionalext/unittest/unit_test_ldso_ld_log.c
浏览文件 @
36c724e1
...
...
@@ -19,8 +19,8 @@
typedef
void
(
*
TEST_FUN
)(
void
);
/**
* @tc.name :
strops
_test_0010
* @tc.desc :
strlwc test args null
* @tc.name :
ld_log
_test_0010
* @tc.desc :
test ld_log_reset normal condition.
* @tc.level : Level 0
*/
static
void
ld_log_test_0010
(
void
)
...
...
libc-test/src/functionalext/unittest/unit_test_ldso_namespace.c
浏览文件 @
36c724e1
...
...
@@ -35,7 +35,7 @@ static void namespace_test_0010(void)
/**
* @tc.name : namespace_test_0020
* @tc.desc : ns_free test
* @tc.desc : ns_free test
normal condition
* @tc.level : Level 0
*/
static
void
namespace_test_0020
(
void
)
...
...
@@ -64,7 +64,7 @@ static void namespace_test_0020(void)
/**
* @tc.name : namespace_test_0030
* @tc.desc : ns_free test
* @tc.desc : ns_free test
arg ns's memebers are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0030
(
void
)
...
...
@@ -86,7 +86,7 @@ static void namespace_test_0030(void)
/**
* @tc.name : namespace_test_0040
* @tc.desc : ns_add_dso test
* @tc.desc : ns_add_dso test
args are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0040
(
void
)
...
...
@@ -97,7 +97,7 @@ static void namespace_test_0040(void)
/**
* @tc.name : namespace_test_0050
* @tc.desc : ns_add_dso test
* @tc.desc : ns_add_dso test
arg dso is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0050
(
void
)
...
...
@@ -109,7 +109,7 @@ static void namespace_test_0050(void)
/**
* @tc.name : namespace_test_0060
* @tc.desc : ns_add_dso test
* @tc.desc : ns_add_dso test
arg ns is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0060
(
void
)
...
...
@@ -121,7 +121,7 @@ static void namespace_test_0060(void)
/**
* @tc.name : namespace_test_0070
* @tc.desc : ns_add_dso test
* @tc.desc : ns_add_dso test
normal condition
* @tc.level : Level 1
*/
static
void
namespace_test_0070
(
void
)
...
...
@@ -138,7 +138,7 @@ static void namespace_test_0070(void)
/**
* @tc.name : namespace_test_0080
* @tc.desc : nslist_add_ns test
* @tc.desc : nslist_add_ns test
many times
* @tc.level : Level 1
*/
static
void
namespace_test_0080
(
void
)
...
...
@@ -166,7 +166,7 @@ static void namespace_test_0080(void)
/**
* @tc.name : namespace_test_0090
* @tc.desc : nslist_add_ns test
* @tc.desc : nslist_add_ns test
arg is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0090
(
void
)
...
...
@@ -177,7 +177,7 @@ static void namespace_test_0090(void)
/**
* @tc.name : namespace_test_0100
* @tc.desc : ns_set_name test
* @tc.desc : ns_set_name test
args are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0100
(
void
)
...
...
@@ -188,7 +188,7 @@ static void namespace_test_0100(void)
/**
* @tc.name : namespace_test_0110
* @tc.desc : ns_set_name test
* @tc.desc : ns_set_name test
arg name is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0110
(
void
)
...
...
@@ -200,7 +200,7 @@ static void namespace_test_0110(void)
/**
* @tc.name : namespace_test_0120
* @tc.desc : ns_set_name test
* @tc.desc : ns_set_name test
arg ns is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0120
(
void
)
...
...
@@ -211,7 +211,7 @@ static void namespace_test_0120(void)
/**
* @tc.name : namespace_test_0130
* @tc.desc : ns_set_env_paths test
* @tc.desc : ns_set_env_paths test
arg ns is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0130
(
void
)
...
...
@@ -222,7 +222,7 @@ static void namespace_test_0130(void)
/**
* @tc.name : namespace_test_0140
* @tc.desc : ns_set_env_paths test
* @tc.desc : ns_set_env_paths test
arg ns.env_paths is NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0140
(
void
)
...
...
@@ -235,7 +235,7 @@ static void namespace_test_0140(void)
/**
* @tc.name : namespace_test_0150
* @tc.desc : ns_set_env_paths test
* @tc.desc : ns_set_env_paths test
arg ns.env_paths is equal to arg name
* @tc.level : Level 1
*/
static
void
namespace_test_0150
(
void
)
...
...
@@ -248,7 +248,7 @@ static void namespace_test_0150(void)
/**
* @tc.name : namespace_test_0160
* @tc.desc : ns_set_env_paths test
* @tc.desc : ns_set_env_paths test
arg name is NULL and ns.env_paths is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0160
(
void
)
...
...
@@ -261,7 +261,7 @@ static void namespace_test_0160(void)
/**
* @tc.name : namespace_test_0170
* @tc.desc : ns_set_env_paths test
* @tc.desc : ns_set_env_paths test
arg name is NULL and ns.env_paths is not NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0170
(
void
)
...
...
@@ -274,7 +274,7 @@ static void namespace_test_0170(void)
/**
* @tc.name : namespace_test_0180
* @tc.desc : ns_set_asan_lib_paths test
* @tc.desc : ns_set_asan_lib_paths test
arg ns is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0180
(
void
)
...
...
@@ -285,7 +285,7 @@ static void namespace_test_0180(void)
/**
* @tc.name : namespace_test_0190
* @tc.desc : ns_set_asan_lib_paths test
* @tc.desc : ns_set_asan_lib_paths test
arg ns.asan_lib_paths is NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0190
(
void
)
...
...
@@ -298,7 +298,7 @@ static void namespace_test_0190(void)
/**
* @tc.name : namespace_test_0200
* @tc.desc : ns_set_asan_lib_paths test
* @tc.desc : ns_set_asan_lib_paths test
arg ns.asan_lib_paths is equal to arg name
* @tc.level : Level 1
*/
static
void
namespace_test_0200
(
void
)
...
...
@@ -311,7 +311,7 @@ static void namespace_test_0200(void)
/**
* @tc.name : namespace_test_0210
* @tc.desc : ns_set_asan_lib_paths test
* @tc.desc : ns_set_asan_lib_paths test
arg name is NULL and ns.asan_lib_paths is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0210
(
void
)
...
...
@@ -324,7 +324,7 @@ static void namespace_test_0210(void)
/**
* @tc.name : namespace_test_0220
* @tc.desc : ns_set_asan_lib_paths test
* @tc.desc : ns_set_asan_lib_paths test
arg name is NULL and ns.asan_lib_paths is not NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0220
(
void
)
...
...
@@ -337,7 +337,7 @@ static void namespace_test_0220(void)
/**
* @tc.name : namespace_test_0230
* @tc.desc : ns_set_permitted_paths test
* @tc.desc : ns_set_permitted_paths test
arg permitted_paths is NULL and ns.permitted_paths is not NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0230
(
void
)
...
...
@@ -351,7 +351,7 @@ static void namespace_test_0230(void)
/**
* @tc.name : namespace_test_0240
* @tc.desc : ns_set_permitted_paths test
* @tc.desc : ns_set_permitted_paths test
args are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0240
(
void
)
...
...
@@ -362,7 +362,7 @@ static void namespace_test_0240(void)
/**
* @tc.name : namespace_test_0250
* @tc.desc : ns_set_permitted_paths test
* @tc.desc : ns_set_permitted_paths test
arg permitted_paths is NULL and ns.permitted_paths is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0250
(
void
)
...
...
@@ -375,7 +375,7 @@ static void namespace_test_0250(void)
/**
* @tc.name : namespace_test_0260
* @tc.desc : ns_set_asan_permitted_paths test
* @tc.desc : ns_set_asan_permitted_paths test
arg asan_permitted_paths is NULL and ns.asan_permitted_paths is not NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0260
(
void
)
...
...
@@ -389,7 +389,7 @@ static void namespace_test_0260(void)
/**
* @tc.name : namespace_test_0270
* @tc.desc : ns_set_asan_permitted_paths test
* @tc.desc : ns_set_asan_permitted_paths test
args are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0270
(
void
)
...
...
@@ -400,7 +400,7 @@ static void namespace_test_0270(void)
/**
* @tc.name : namespace_test_0280
* @tc.desc : ns_set_asan_permitted_paths test
* @tc.desc : ns_set_asan_permitted_paths test
arg asan_permitted_paths is NULL and ns.asan_permitted_paths is NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0280
(
void
)
...
...
@@ -413,7 +413,7 @@ static void namespace_test_0280(void)
/**
* @tc.name : namespace_test_0290
* @tc.desc : ns_set_separated test
* @tc.desc : ns_set_separated test
arg ns is NULL and separated is false
* @tc.level : Level 2
*/
static
void
namespace_test_0290
(
void
)
...
...
@@ -424,7 +424,7 @@ static void namespace_test_0290(void)
/**
* @tc.name : namespace_test_0300
* @tc.desc : ns_set_allowed_libs test
* @tc.desc : ns_set_allowed_libs test
arg ns is NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0300
(
void
)
...
...
@@ -435,7 +435,7 @@ static void namespace_test_0300(void)
/**
* @tc.name : namespace_test_0310
* @tc.desc : ns_set_allowed_libs test
* @tc.desc : ns_set_allowed_libs test
arg ns is ns.allowed_libs NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0310
(
void
)
...
...
@@ -448,7 +448,7 @@ static void namespace_test_0310(void)
/**
* @tc.name : namespace_test_0320
* @tc.desc : ns_set_allowed_libs test
* @tc.desc : ns_set_allowed_libs test
normal condition
* @tc.level : Level 0
*/
static
void
namespace_test_0320
(
void
)
...
...
@@ -462,7 +462,7 @@ static void namespace_test_0320(void)
/**
* @tc.name : namespace_test_0330
* @tc.desc : ns_set_allowed_libs test
* @tc.desc : ns_set_allowed_libs test
allowed_libs is NULL and ns.allowed_libs is NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0330
(
void
)
...
...
@@ -475,7 +475,7 @@ static void namespace_test_0330(void)
/**
* @tc.name : namespace_test_0400
* @tc.desc : ns_set_allowed_libs test
* @tc.desc : ns_set_allowed_libs test
allowed_libs is NULL and ns.allowed_libs is not NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0400
(
void
)
...
...
@@ -489,7 +489,7 @@ static void namespace_test_0400(void)
/**
* @tc.name : namespace_test_0340
* @tc.desc : ns_add_inherit test
* @tc.desc : ns_add_inherit test
arg ns_inherited and shared_libs are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0340
(
void
)
...
...
@@ -501,7 +501,7 @@ static void namespace_test_0340(void)
/**
* @tc.name : namespace_test_0350
* @tc.desc : ns_add_inherit test
* @tc.desc : ns_add_inherit test
args are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0350
(
void
)
...
...
@@ -513,7 +513,7 @@ static void namespace_test_0350(void)
/**
* @tc.name : namespace_test_0360
* @tc.desc : ns_add_inherit test
* @tc.desc : ns_add_inherit test
arg ns and shared_libs are NULL
* @tc.level : Level 2
*/
static
void
namespace_test_0360
(
void
)
...
...
@@ -525,7 +525,7 @@ static void namespace_test_0360(void)
/**
* @tc.name : namespace_test_0370
* @tc.desc : is_accessible test
* @tc.desc : is_accessible test
arg lib_pathname is NULL
* @tc.level : Level 1
*/
static
void
namespace_test_0370
(
void
)
...
...
@@ -538,7 +538,7 @@ static void namespace_test_0370(void)
/**
* @tc.name : namespace_test_0380
* @tc.desc : is_accessible test
* @tc.desc : is_accessible test
args is (&ns, NULL, true, false) and ns.separated is false
* @tc.level : Level 1
*/
static
void
namespace_test_0380
(
void
)
...
...
@@ -551,7 +551,7 @@ static void namespace_test_0380(void)
/**
* @tc.name : namespace_test_0390
* @tc.desc : is_accessible test
* @tc.desc : is_accessible test
args is (&ns, "/data/test.so", true, false) and ns.separated is false
* @tc.level : Level 1
*/
static
void
namespace_test_0390
(
void
)
...
...
@@ -575,7 +575,7 @@ static void namespace_test_0390(void)
/**
* @tc.name : namespace_test_0410
* @tc.desc : is_sharable test
* @tc.desc : is_sharable test
args are NULL
* @tc.level : Level 0
*/
static
void
namespace_test_0410
(
void
)
...
...
libc-test/src/functionalext/unittest/unit_test_ldso_ns_config.c
浏览文件 @
36c724e1
...
...
@@ -20,7 +20,7 @@ typedef void (*TEST_FUN)(void);
/**
* @tc.name : ns_config_0010
* @tc.desc :
test error config
* @tc.desc :
Set default error callback for configor
* @tc.level : Level 1
*/
static
void
ns_config_test_0010
(
void
)
...
...
@@ -40,7 +40,7 @@ int errorback(const char* format, ...)
/**
* @tc.name : ns_config_0030
* @tc.desc :
test error config
* @tc.desc :
Set custom error callback for configor
* @tc.level : Level 0
*/
static
void
ns_config_test_0020
(
void
)
...
...
@@ -55,7 +55,7 @@ static void ns_config_test_0020(void)
/**
* @tc.name : ns_config_0030
* @tc.desc :
test parse config
* @tc.desc :
Test parse with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0030
(
void
)
...
...
@@ -70,7 +70,7 @@ static void ns_config_test_0030(void)
/**
* @tc.name : ns_config_0040
* @tc.desc :
test get_namespaces
* @tc.desc :
Test get_namespaces with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0040
(
void
)
...
...
@@ -84,7 +84,7 @@ static void ns_config_test_0040(void)
/**
* @tc.name : ns_config_0050
* @tc.desc :
test get_namespaces
* @tc.desc :
Test get_namespaces with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0050
(
void
)
...
...
@@ -105,7 +105,7 @@ static void ns_config_test_0050(void)
/**
* @tc.name : ns_config_0060
* @tc.desc :
test get_namespaces
* @tc.desc :
Test get_namespaces with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0060
(
void
)
...
...
@@ -126,7 +126,7 @@ static void ns_config_test_0060(void)
/**
* @tc.name : ns_config_0070
* @tc.desc :
test get_lib_paths
* @tc.desc :
Test get_lib_paths with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0070
(
void
)
...
...
@@ -140,7 +140,7 @@ static void ns_config_test_0070(void)
/**
* @tc.name : ns_config_0080
* @tc.desc :
test get_lib_paths
* @tc.desc :
Test get_lib_paths with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0080
(
void
)
...
...
@@ -154,7 +154,7 @@ static void ns_config_test_0080(void)
/**
* @tc.name : ns_config_0090
* @tc.desc :
test get_asan_lib_paths
* @tc.desc :
Test get_asan_lib_paths with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0090
(
void
)
...
...
@@ -168,7 +168,7 @@ static void ns_config_test_0090(void)
/**
* @tc.name : ns_config_0100
* @tc.desc :
test get_asan_lib_paths
* @tc.desc :
Test get_asan_lib_paths with invalid input
* @tc.level : Level 2
*/
static
void
ns_config_test_0100
(
void
)
...
...
musl_config.gni
浏览文件 @
36c724e1
...
...
@@ -69,8 +69,3 @@ declare_args() {
product_path = ""
}
}
declare_args() {
# for unit test
musl_unit_test_flag = false
}
musl_template.gni
浏览文件 @
36c724e1
...
...
@@ -715,10 +715,6 @@ template("musl_libs") {
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
}
if (musl_unit_test_flag) {
defines += [ "UNIT_TEST_STATIC" ]
}
configs -= musl_inherited_configs
configs += [
...
...
porting/linux/user/src/hook/musl_preinit.c
浏览文件 @
36c724e1
...
...
@@ -36,12 +36,6 @@ which need be escaped.
#include <malloc.h>
#include "musl_log.h"
#ifdef UNIT_TEST_STATIC
#define UT_STATIC
#else
#define UT_STATIC static
#endif
void
*
ohos_malloc_hook_init_function
(
size_t
bytes
);
static
struct
MallocDispatchType
__ohos_malloc_hook_init_dispatch
=
{
...
...
@@ -85,7 +79,7 @@ static void get_native_hook_param(char *buf, unsigned int buf_len)
#endif
}
UT_STATIC
void
get_memleak_hook_param
()
static
void
get_memleak_hook_param
()
{
#ifdef OHOS_ENABLE_PARAMETER
const
char
*
key
=
kMemTrackPropertyEnable
;
...
...
@@ -100,7 +94,7 @@ UT_STATIC void get_memleak_hook_param()
#endif
}
UT_STATIC
int
parse_hook_variable
(
enum
EnumHookMode
*
mode
,
char
*
path
,
int
size
)
static
int
parse_hook_variable
(
enum
EnumHookMode
*
mode
,
char
*
path
,
int
size
)
{
if
(
!
mode
||
!
path
||
size
<=
0
)
{
return
-
1
;
...
...
@@ -151,7 +145,7 @@ UT_STATIC int parse_hook_variable(enum EnumHookMode* mode, char* path, int size)
return
0
;
}
UT_STATIC
bool
get_proc_name
(
pid_t
pid
,
char
*
buf
,
unsigned
int
buf_len
)
static
bool
get_proc_name
(
pid_t
pid
,
char
*
buf
,
unsigned
int
buf_len
)
{
if
(
pid
<=
0
)
{
return
false
;
...
...
@@ -288,7 +282,7 @@ static bool init_hook_functions(void* shared_library_handler, struct MallocDispa
return
true
;
}
UT_STATIC
void
clear_function_table
()
static
void
clear_function_table
()
{
for
(
size_t
i
=
0
;
i
<
LAST_FUNCTION
;
i
++
)
{
function_of_shared_lib
[
i
]
=
NULL
;
...
...
@@ -475,7 +469,7 @@ static void __set_default_malloc()
atomic_store_explicit
(
&
__musl_libc_globals
.
current_dispatch_table
,
(
volatile
const
long
long
)
NULL
,
memory_order_seq_cst
);
}
UT_STATIC
void
__restore_hook_function_table
()
static
void
__restore_hook_function_table
()
{
for
(
size_t
i
=
0
;
i
<
LAST_FUNCTION
;
i
++
)
{
if
(
__get_memleak_hook_flag
())
{
...
...
@@ -486,7 +480,7 @@ UT_STATIC void __restore_hook_function_table()
}
}
UT_STATIC
void
__install_malloc_hook
()
static
void
__install_malloc_hook
()
{
if
(
__get_memleak_hook_flag
())
{
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录