Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2f0a58a7
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看板
未验证
提交
2f0a58a7
编写于
9月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5302 Adapt to failures caused by testnative_hispark_aries_linux.hap
Merge pull request !5302 from jiyong/cherry-pick-1661827616
上级
e11307f6
af7e3323
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
168 deletion
+0
-168
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
+0
-168
未找到文件。
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
浏览文件 @
2f0a58a7
...
...
@@ -614,70 +614,6 @@ HWTEST_F(AbilityMgrTest2, testStopAbilityIllegal, Function | MediumTest | Level2
printf
(
"------end testStopAbilityIllegal------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_API_0008
* @tc.name : testConnectAbility parameter legal test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
AbilityMgrTest2
,
testConnectAbility
,
Function
|
MediumTest
|
Level1
)
{
printf
(
"------start testConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.openharmony.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
int
result
=
ConnectAbility
(
&
want
,
&
g_conn
,
this
);
struct
timespec
ts
=
{};
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
ts
.
tv_sec
+=
WAIT_TIMEOUT
;
sem_timedwait
(
&
g_sem
,
&
ts
);
printf
(
"sem exit
\n
"
);
printf
(
"ret is %d
\n
"
,
result
);
EXPECT_EQ
(
result
,
0
);
EXPECT_EQ
(
g_errorCode
,
16
);
DisconnectAbility
(
&
g_conn
);
sleep
(
1
);
ClearElement
(
&
element
);
ClearWant
(
&
want
);
printf
(
"------end testConnectAbility------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_API_0010
* @tc.name : testWantMathBundle
* @tc.desc : [C- SOFTWARE -0100]
* @tc.author : lijiashan
*/
HWTEST_F
(
AbilityMgrTest2
,
testDisConnectAbility
,
Function
|
MediumTest
|
Level1
)
{
printf
(
"------start testDisConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.openharmony.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
int
result
=
ConnectAbility
(
&
want
,
&
g_conn
,
this
);
struct
timespec
ts
=
{};
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
ts
.
tv_sec
+=
WAIT_TIMEOUT
;
sem_timedwait
(
&
g_sem
,
&
ts
);
printf
(
"sem exit
\n
"
);
printf
(
"ret of connect is %d
\n
"
,
result
);
EXPECT_EQ
(
g_errorCode
,
16
);
if
(
g_errorCode
==
16
)
{
result
=
DisconnectAbility
(
&
g_conn
);
sleep
(
2
);
EXPECT_EQ
(
result
,
0
);
printf
(
"ret of disconnect is %d
\n
"
,
result
);
}
ClearElement
(
&
element
);
ClearWant
(
&
want
);
printf
(
"------end testDisConnectAbility------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_API_0009
* @tc.name : testConnectAbilityIllegal parameter illegal test
...
...
@@ -702,38 +638,6 @@ HWTEST_F(AbilityMgrTest2, testConnectAbilityIllegal, Function | MediumTest | Lev
printf
(
"------end testConnectAbilityIllegal------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_API_0011
* @tc.name : testDisConnectAbilityIllegal parameter illegal test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
AbilityMgrTest2
,
testDisConnectAbilityIllegal
,
Function
|
MediumTest
|
Level1
)
{
printf
(
"------start testDisConnectAbilityIllegal------
\n
"
);
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.openharmony.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
int
result
=
ConnectAbility
(
&
want
,
&
g_conn
,
this
);
struct
timespec
ts
=
{};
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
ts
.
tv_sec
+=
WAIT_TIMEOUT
;
sem_timedwait
(
&
g_sem
,
&
ts
);
printf
(
"sem exit
\n
"
);
printf
(
"ret is of connect is %d
\n
"
,
g_errorCode
);
EXPECT_EQ
(
g_errorCode
,
16
);
EXPECT_EQ
(
result
,
0
);
g_errorCode
=
DisconnectAbility
(
nullptr
);
int
expect
=
-
10
;
EXPECT_EQ
(
g_errorCode
,
expect
);
printf
(
"ret of disconnect is %d
\n
"
,
g_errorCode
);
ClearElement
(
&
element
);
ClearWant
(
&
want
);
printf
(
"------end testDisConnectAbilityIllegal------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_API_0012
* @tc.name : testTerminateAbility parameter legal test
...
...
@@ -762,45 +666,6 @@ HWTEST_F(AbilityMgrTest2, testTerminateAbility, Function | MediumTest | Level1)
printf
(
"------end testTerminateAbility------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_WANT_0001
* @tc.name : test Want Match BundleInfo
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
AbilityMgrTest2
,
testWantMatchBundle
,
Function
|
MediumTest
|
Level1
)
{
printf
(
"------start testWantMathBundle------
\n
"
);
Want
want
;
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementBundleName
(
&
element
,
"com.openharmony.testnative"
);
SetElementDeviceID
(
&
element
,
""
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
g_errorCode
=
QueryAbilityInfo
(
&
want
,
&
abilityInfo
);
printf
(
"ret of query is %d
\n
"
,
g_errorCode
);
EXPECT_EQ
(
g_errorCode
,
0
);
if
(
g_errorCode
==
0
)
{
printf
(
"abilityInfo.name is %s
\n
"
,
abilityInfo
.
name
);
}
int
result
=
StartAbility
(
&
want
);
sleep
(
2
);
printf
(
"result of startAbility is %d
\n
"
,
result
);
EXPECT_EQ
(
result
,
0
);
printf
(
"element is %s
\n
"
,
want
.
element
->
bundleName
);
printf
(
"element is %s
\n
"
,
want
.
element
->
abilityName
);
StopAbility
(
&
want
);
sleep
(
1
);
g_errorCode
=
StopAbility
(
&
want
);
sleep
(
2
);
ClearElement
(
&
element
);
ClearWant
(
&
want
);
printf
(
"------end testWantMathBundle------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_WANT_0004
* @tc.name : test Want Not Match BundleInfo
...
...
@@ -900,39 +765,6 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathAbility, Function | MediumTest | Level
printf
(
"------end testWantOnlyMathAbility------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_WANT_0005
* @tc.name : test WantData Match DataLength
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
AbilityMgrTest2
,
testWantDataMatchLength
,
Function
|
MediumTest
|
Level1
)
{
printf
(
"------start testWantDataMatchLength------
\n
"
);
Want
want
;
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementBundleName
(
&
element
,
"com.openharmony.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
5
);
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
g_errorCode
=
QueryAbilityInfo
(
&
want
,
&
abilityInfo
);
printf
(
"ret is %d
\n
"
,
g_errorCode
);
EXPECT_TRUE
(
g_errorCode
==
0
);
int
result
=
StartAbility
(
&
want
);
sleep
(
2
);
printf
(
"result of startAbility is %d
\n
"
,
result
);
EXPECT_TRUE
(
result
==
0
);
EXPECT_STREQ
((
char
*
)(
want
.
data
),
"test"
);
EXPECT_EQ
(
want
.
dataLength
,
5
);
StopAbility
(
&
want
);
sleep
(
1
);
printf
(
"------end testWantDataMatchLength------
\n
"
);
}
/**
* @tc.number : SUB_APPEXECFWK_AMS_WANT_0006
* @tc.name : test WantData Not Match DataLength
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录