Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
8cc52091
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8cc52091
编写于
3月 04, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1132 feat:修复使用不规范的测试用例
Merge pull request !1132 from zhangdengyu/muslUpdate0303
上级
a104497e
f995c7c7
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
30 addition
and
30 deletion
+30
-30
testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp
...suites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp
+1
-1
testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp
testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp
+3
-3
testsuites/unittest/libc/io/full/IO_test_locale_001.cpp
testsuites/unittest/libc/io/full/IO_test_locale_001.cpp
+3
-3
testsuites/unittest/libc/io/full/IO_test_locale_002.cpp
testsuites/unittest/libc/io/full/IO_test_locale_002.cpp
+3
-3
testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp
testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp
+1
-1
testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp
...uites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp
+1
-1
testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp
testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp
+1
-1
testsuites/unittest/process/basic/process/full/process_test_049.cpp
.../unittest/process/basic/process/full/process_test_049.cpp
+6
-6
testsuites/unittest/process/basic/process/full/process_test_050.cpp
.../unittest/process/basic/process/full/process_test_050.cpp
+4
-4
testsuites/unittest/process/basic/process/full/process_test_051.cpp
.../unittest/process/basic/process/full/process_test_051.cpp
+5
-5
testsuites/unittest/process/basic/process/smoke/process_test_010.cpp
...unittest/process/basic/process/smoke/process_test_010.cpp
+1
-1
testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp
...unittest/process/basic/pthread/smoke/pthread_test_012.cpp
+1
-1
未找到文件。
testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp
浏览文件 @
8cc52091
...
...
@@ -53,7 +53,7 @@ static UINT32 TestCase(VOID)
char
sentence1
[
15
]
=
"Hello World"
;
char
a
[
4
]
=
{
0
};
retValue
=
sprintf_s
(
a
,
sizeof
(
a
),
"%d"
,
i
);
ICUNIT_ASSERT_NOT_EQUAL
(
retValue
,
NULL
,
retValue
);
ICUNIT_ASSERT_NOT_EQUAL
(
retValue
,
0
,
retValue
);
retValue
=
strcat_s
(
sentence1
,
sizeof
(
sentence1
),
a
);
ICUNIT_ASSERT_EQUAL
(
retValue
,
0
,
retValue
);
ret
=
write
(
*
writeFd
,
sentence1
,
strlen
(
sentence1
)
+
1
);
...
...
testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp
浏览文件 @
8cc52091
...
...
@@ -44,7 +44,7 @@ static UINT32 testcase(VOID)
return
LOS_NOK
;
}
confstr
(
_CS_PATH
,
pathbuf
,
n
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
pathbuf
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
pathbuf
,
NULL
,
-
1
);
free
(
pathbuf
);
pathbuf
=
NULL
;
...
...
@@ -57,7 +57,7 @@ static UINT32 testcase(VOID)
return
LOS_NOK
;
}
confstr
(
_CS_GNU_LIBPTHREAD_VERSION
,
gun_libpthread_version_buf
,
n
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
gun_libpthread_version_buf
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
gun_libpthread_version_buf
,
NULL
,
-
1
);
free
(
gun_libpthread_version_buf
);
gun_libpthread_version_buf
=
NULL
;
...
...
@@ -70,7 +70,7 @@ static UINT32 testcase(VOID)
return
LOS_NOK
;
}
confstr
(
_CS_GNU_LIBC_VERSION
,
gun_libc_version_buf
,
n
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
gun_libc_version_buf
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
gun_libc_version_buf
,
NULL
,
-
1
);
free
(
gun_libc_version_buf
);
gun_libc_version_buf
=
NULL
;
...
...
testsuites/unittest/libc/io/full/IO_test_locale_001.cpp
浏览文件 @
8cc52091
...
...
@@ -47,17 +47,17 @@ static UINT32 testcase(VOID)
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
"en_US.UTF-8"
));
strftime
(
buffer
,
80
,
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
"zh_CN.UTF-8"
));
strftime
(
buffer
,
80
,
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
""
));
strftime
(
buffer
,
80
,
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
setlocale
(
LC_ALL
,
"C"
);
return
LOS_OK
;
...
...
testsuites/unittest/libc/io/full/IO_test_locale_002.cpp
浏览文件 @
8cc52091
...
...
@@ -47,17 +47,17 @@ static UINT32 testcase(VOID)
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
"en_US.UTF-8"
));
(
void
)
strftime
(
buffer
,
sizeof
(
buffer
),
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
"zh_CN.UTF-8"
));
(
void
)
strftime
(
buffer
,
sizeof
(
buffer
),
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
printf
(
"Locale is: %s
\n
"
,
setlocale
(
LC_TIME
,
""
));
(
void
)
strftime
(
buffer
,
sizeof
(
buffer
),
"%c"
,
timer
);
printf
(
"Date is: %s
\n
"
,
buffer
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
buffer
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
buffer
,
NULL
,
-
1
);
setlocale
(
LC_ALL
,
"C"
);
return
LOS_OK
;
...
...
testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp
浏览文件 @
8cc52091
...
...
@@ -89,7 +89,7 @@ static UINT32 testcase(VOID)
printf
(
"%s
\n
"
,
nl_langinfo
(
CRNCYSTR
));
char
*
string
=
nl_langinfo
(
CRNCYSTR
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
string
,
NULL
,
string
);
ICUNIT_ASSERT_NOT_EQUAL
(
string
,
NULL
,
string
);
setlocale
(
LC_ALL
,
"C"
);
return
LOS_OK
;
...
...
testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp
浏览文件 @
8cc52091
...
...
@@ -57,7 +57,7 @@ static UINT32 testcase(VOID) {
printf
(
"%s
\n
"
,
nl_langinfo_l
(
RADIXCHAR
,
reinterpret_cast
<
locale_t
>
(
const_cast
<
char
*>
(
"zh_CN.UTF-8"
))));
char
*
string
=
nl_langinfo_l
(
CRNCYSTR
,
reinterpret_cast
<
locale_t
>
(
const_cast
<
char
*>
(
"zh_CN.UTF-8"
)));
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
string
,
NULL
,
string
);
ICUNIT_ASSERT_NOT_EQUAL
(
string
,
NULL
,
string
);
setlocale
(
LC_ALL
,
"C"
);
return
LOS_OK
;
...
...
testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp
浏览文件 @
8cc52091
...
...
@@ -77,7 +77,7 @@ static UINT32 testcase(VOID)
if
(
mnt
&&
!
(
feof
(
fp
)
||
ferror
(
fp
)))
{
ret
=
hasmntopt
(
mnt
,
opt
);
printf
(
"hasmntopt=%s
\n
"
,
ret
);
ICUNIT_ASSERT_NOT_EQUAL
_NULL
(
ret
,
NULL
,
-
1
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
NULL
,
-
1
);
mnt
=
getmntent
(
fp
);
}
...
...
testsuites/unittest/process/basic/process/full/process_test_049.cpp
浏览文件 @
8cc52091
...
...
@@ -45,11 +45,11 @@ static int TestThread(void *arg)
int
ret
=
0
;
pthread_t
gTh
;
ret
=
pthread_create
(
&
gTh
,
NULL
,
PthreadTest115
,
NULL
);
ICUNIT_ASSERT_EQUAL
_NULL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ret
=
pthread_join
(
gTh
,
NULL
);
ICUNIT_ASSERT_EQUAL
_NULL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
_NULL
(
g_usetTestCount
,
1
,
g_usetTestCount
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
g_usetTestCount
,
1
,
g_usetTestCount
);
*
g_shmptr
=
100
;
// 100, set shared num.
...
...
@@ -66,11 +66,11 @@ static int TestThread(void *arg)
ret
=
waitpid
(
pid
,
NULL
,
0
);
printf
(
"waitpid ret : %d errno : %d pid : %d getpid : %d
\n
"
,
ret
,
errno
,
pid
,
getpid
());
ICUNIT_ASSERT_EQUAL
_NULL
(
ret
,
pid
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
pid
,
ret
);
*
g_shmptr
=
data
;
EXIT:
return
NULL
;
return
0
;
}
// This testcase us used for undefination of LOSCFG_USER_TEST_SMP
...
...
@@ -100,7 +100,7 @@ static int Testcase(void)
ICUNIT_GOTO_EQUAL
(
*
g_shmptr
,
arg
,
*
g_shmptr
,
EXIT2
);
ret
=
waitpid
(
pid
,
&
status
,
NULL
);
ret
=
waitpid
(
pid
,
&
status
,
0
);
ICUNIT_GOTO_EQUAL
(
ret
,
pid
,
ret
,
EXIT2
);
EXIT2:
...
...
testsuites/unittest/process/basic/process/full/process_test_050.cpp
浏览文件 @
8cc52091
...
...
@@ -39,10 +39,10 @@ static int TestThread(void *arg)
printf
(
"TestThread ppid : %d g_ppid : %d
\n
"
,
ppid
,
g_ppid
);
ICUNIT_ASSERT_EQUAL
_NULL
(
ppid
,
g_ppid
,
g_ppid
);
ICUNIT_ASSERT_EQUAL
(
ppid
,
g_ppid
,
g_ppid
);
*
g_shmptr
=
100
;
// 100, set shared num.
return
NULL
;
return
0
;
}
// This testcase us used for undefination of LOSCFG_USER_TEST_SMP
...
...
@@ -55,7 +55,7 @@ static int Testcase(void)
int
ret
;
int
count
;
pid_t
pid
;
int
shmid
=
shmget
(
IPC_PRIVATE
,
sizeof
(
int
),
IPC_CREAT
|
0600
);
// 0600 config of shmget
ICUNIT_ASSERT_NOT_EQUAL
(
shmid
,
-
1
,
shmid
);
...
...
@@ -73,7 +73,7 @@ static int Testcase(void)
stackTop
=
reinterpret_cast
<
char
*>
(
reinterpret_cast
<
unsigned
long
>
(
stack
)
+
arg
);
pid
=
clone
(
TestThread
,
(
void
*
)
stackTop
,
CLONE_PARENT
,
&
arg
);
ret
=
waitpid
(
pid
,
&
status
,
NULL
);
ret
=
waitpid
(
pid
,
&
status
,
0
);
ICUNIT_GOTO_EQUAL
(
ret
,
-
1
,
ret
,
EXIT2
);
count
=
0
;
...
...
testsuites/unittest/process/basic/process/full/process_test_051.cpp
浏览文件 @
8cc52091
...
...
@@ -41,7 +41,7 @@ static int TestThread(void *arg)
printf
(
"TestThread ppid : %d g_ppid : %d
\n
"
,
ppid
,
g_ppid
);
ICUNIT_ASSERT_EQUAL
_NULL
(
ppid
,
g_ppid
,
g_ppid
);
ICUNIT_ASSERT_EQUAL
(
ppid
,
g_ppid
,
g_ppid
);
*
g_shmptr
=
1000
;
// 1000, set shared num.
...
...
@@ -54,11 +54,11 @@ static int TestThread(void *arg)
}
ret
=
waitpid
(
pid
,
NULL
,
0
);
ICUNIT_ASSERT_EQUAL
_NULL
(
ret
,
pid
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
pid
,
ret
);
*
g_shmptr
=
100
;
// 100, set shared num.
EXIT:
return
NULL
;
return
0
;
}
// This testcase us used for undefination of LOSCFG_USER_TEST_SMP
...
...
@@ -70,7 +70,7 @@ static int Testcase(void)
void
*
stack
;
char
*
stackTop
;
int
ret
;
int
shmid
=
shmget
(
IPC_PRIVATE
,
sizeof
(
int
),
IPC_CREAT
|
0600
);
// 0600 config of shmget
ICUNIT_ASSERT_NOT_EQUAL
(
shmid
,
-
1
,
shmid
);
...
...
@@ -90,7 +90,7 @@ static int Testcase(void)
ICUNIT_GOTO_EQUAL
(
*
g_shmptr
,
100
,
*
g_shmptr
,
EXIT2
);
// 100, assert g_shmptr equal to this.
ret
=
waitpid
(
pid
,
&
status
,
NULL
);
ret
=
waitpid
(
pid
,
&
status
,
0
);
ICUNIT_GOTO_EQUAL
(
ret
,
-
1
,
ret
,
EXIT2
);
EXIT2:
...
...
testsuites/unittest/process/basic/process/smoke/process_test_010.cpp
浏览文件 @
8cc52091
...
...
@@ -105,7 +105,7 @@ static int Testcase(void)
exit
(
Child
());
}
else
if
(
ret
>
0
)
{
pid
=
ret
;
ret
=
waitpid
(
pid
,
&
status
,
NULL
);
ret
=
waitpid
(
pid
,
&
status
,
0
);
status
=
WEXITSTATUS
(
status
);
ICUNIT_ASSERT_EQUAL
(
ret
,
pid
,
ret
);
ICUNIT_ASSERT_EQUAL
(
status
,
0
,
status
);
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp
浏览文件 @
8cc52091
...
...
@@ -33,7 +33,7 @@
static
int
Testcase
(
void
)
{
int
ret
;
ret
=
Syscall
(
SYS_set_thread_area
,
NULL
,
0
,
0
,
0
);
ret
=
Syscall
(
SYS_set_thread_area
,
0x0
,
0
,
0
,
0
);
ICUNIT_ASSERT_EQUAL
(
ret
,
EINVAL
,
ret
);
ret
=
Syscall
(
SYS_set_thread_area
,
0x100
,
0
,
0
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录