Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3141b800
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3141b800
编写于
5月 13, 2021
作者:
S
selectfromemp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify the possible crash points in process
Change-Id: I11cf71f4e6768d1a717f1e4cd8ad803b2fe7ed8d
上级
1d46b68e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
13 deletion
+17
-13
kernel_lite/process_posix/src/ActsProcessApiTest.cpp
kernel_lite/process_posix/src/ActsProcessApiTest.cpp
+2
-0
kernel_lite/process_posix/src/PthreadAttrTest.cpp
kernel_lite/process_posix/src/PthreadAttrTest.cpp
+5
-5
kernel_lite/process_posix/src/PthreadBasicApiTest.cpp
kernel_lite/process_posix/src/PthreadBasicApiTest.cpp
+10
-8
未找到文件。
kernel_lite/process_posix/src/ActsProcessApiTest.cpp
浏览文件 @
3141b800
...
...
@@ -223,6 +223,7 @@ HWTEST_F(ActsProcessApiTest, testPthreadSetnameNp1100, Function | MediumTest | L
<<
"ErrInfo: pthread_setname_np thread:='"
<<
newThread
<<
"(0x"
<<
newThread
<<
")' *name:='fThreadName',"
<<
" --> returnVal:='"
<<
returnVal
<<
"'"
;
EXPECT_EQ
(
pthread_join
(
newThread
,
nullptr
),
0
)
<<
"pthread join errno = "
<<
errno
;
}
/**
...
...
@@ -263,4 +264,5 @@ HWTEST_F(ActsProcessApiTest, testPthreadAttrGetguardsize0100, Function | MediumT
EXPECT_EQ
(
guardsize
,
4096
)
<<
"ErrInfo: pthread_attr_getguardsize attr:='&threadAttr' guardsize:='&guardsize',"
<<
" --> returnVal:='"
<<
returnVal
<<
"', guardsize:='"
<<
guardsize
<<
"'"
;
EXPECT_EQ
(
pthread_join
(
newThread
,
nullptr
),
0
)
<<
"pthread join errno = "
<<
errno
;
}
kernel_lite/process_posix/src/PthreadAttrTest.cpp
浏览文件 @
3141b800
...
...
@@ -93,7 +93,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetscope, Function | MediumTest | Level3)
ASSERT_EQ
(
pthread_create
(
&
tid
,
&
attr
,
ThreadPthreadAttrSetscope
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
20
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
pthread_attr_destroy
(
&
attr
),
0
);
}
...
...
@@ -133,7 +133,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetguardsize, Function | MediumTest | Level
ASSERT_EQ
(
pthread_create
(
&
tid
,
&
attr
,
ThreadPthreadAttrSetguardsize
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
20
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
pthread_attr_destroy
(
&
attr
),
0
);
}
...
...
@@ -176,7 +176,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetstacksize, Function | MediumTest | Level
ASSERT_EQ
(
pthread_create
(
&
tid
,
&
attr
,
ThreadPthreadAttrSetstacksize
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
20
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
pthread_attr_destroy
(
&
attr
),
0
);
}
...
...
@@ -241,7 +241,7 @@ HWTEST_F(PthreadTest, testPthreadAttrSetstack, Function | MediumTest | Level3)
EXPECT_EQ
(
pthread_create
(
&
tid
,
&
attr
,
ThreadPthreadAttrSetstack
,
stackAddr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
pthread_attr_destroy
(
&
attr
),
0
);
}
...
...
@@ -296,5 +296,5 @@ HWTEST_F(PthreadTest, testPthreadGetattrNp, Function | MediumTest | Level3)
pthread_t
tid
;
EXPECT_EQ
(
pthread_create
(
&
tid
,
nullptr
,
ThreadPthreadGetattrNp
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
}
kernel_lite/process_posix/src/PthreadBasicApiTest.cpp
浏览文件 @
3141b800
...
...
@@ -308,7 +308,9 @@ HWTEST_F(PthreadTest, testPthreadSpecificAll, Function | MediumTest | Level3)
ASSERT_EQ
(
pthread_create
(
&
tid2
,
nullptr
,
ThreadPthreadSpecificAll
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_cancel
(
tid1
);
pthread_join
(
tid1
,
nullptr
);
pthread_cancel
(
tid2
);
pthread_join
(
tid2
,
nullptr
);
EXPECT_EQ
(
g_intPthreadSpecificAll
,
5
);
}
...
...
@@ -340,7 +342,7 @@ HWTEST_F(PthreadTest, testPthreadSpecificAllDelete, Function | MediumTest | Leve
pthread_t
tid
;
ASSERT_EQ
(
pthread_create
(
&
tid
,
nullptr
,
ThreadPthreadSpecificAllDelete
,
(
void
*
)
&
data
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
data
,
1
);
}
...
...
@@ -374,7 +376,7 @@ HWTEST_F(PthreadTest, testPthreadCleanupPushPopBasic, Function | MediumTest | Le
CheckStep
(
1
);
ASSERT_EQ
(
pthread_create
(
&
tid
,
nullptr
,
ThreadTestPush
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
CheckStep
(
4
),
(
uint64_t
)
0x1234
);
}
...
...
@@ -404,7 +406,7 @@ HWTEST_F(PthreadTest, testPthreadCleanupPushPopParam, Function | MediumTest | Le
CheckStep
(
1
);
ASSERT_EQ
(
pthread_create
(
&
tid
,
nullptr
,
ThreadTestPushParam
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
CheckStep
(
3
),
(
uint64_t
)
0x123
);
}
...
...
@@ -439,7 +441,7 @@ HWTEST_F(PthreadTest, testPop, Function | MediumTest | Level3)
CheckStep
(
1
);
ASSERT_EQ
(
pthread_create
(
&
tid
,
nullptr
,
ThreadTestop
,
nullptr
),
0
)
<<
"> return errno"
;
Msleep
(
100
);
pthread_
cancel
(
tid
);
pthread_
join
(
tid
,
nullptr
);
EXPECT_EQ
(
CheckStep
(
3
),
(
uint64_t
)
0x123
);
}
...
...
@@ -525,8 +527,8 @@ HWTEST_F(PthreadTest, testBarrierWait, Function | MediumTest | Level3)
ADD_FAILURE
();
}
Msleep
(
50
);
pthread_
cancel
(
tid
);
pthread_
cancel
(
tid1
);
pthread_
join
(
tid
,
nullptr
);
pthread_
join
(
tid1
,
nullptr
);
EXPECT_EQ
(
pthread_barrier_destroy
(
&
g_barrier
),
0
)
<<
"> return errno"
;
EXPECT_EQ
(
CheckStep
(
3
),
(
uint64_t
)
0x123
);
EXPECT_EQ
(
intParam
,
2
);
...
...
@@ -567,8 +569,8 @@ HWTEST_F(PthreadTest, testBarrierAlwaysWait, Function | MediumTest | Level3)
if
((
reInt
!=
PTHREAD_BARRIER_SERIAL_THREAD
)
&&
(
reInt
!=
0
))
{
ADD_FAILURE
();
}
pthread_
cancel
(
tid
);
pthread_
cancel
(
tid1
);
pthread_
join
(
tid
,
nullptr
);
pthread_
join
(
tid1
,
nullptr
);
EXPECT_EQ
(
pthread_barrier_destroy
(
&
barrier
),
0
)
<<
"> return errno"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录