Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a5622796
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看板
提交
a5622796
编写于
9月 26, 2021
作者:
J
jiyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jiyong@huawei.com
Signed-off-by:
N
jiyong
<
jiyong@huawei.com
>
上级
e9f9d657
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
102 addition
and
88 deletion
+102
-88
aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js
...ctsamscallbackfifthscene/entry/src/main/js/default/app.js
+14
-0
aafwk_lite/ability_posix/src/AbilityMgrTest.cpp
aafwk_lite/ability_posix/src/AbilityMgrTest.cpp
+23
-23
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
+23
-23
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json
...r/sceneProject/bmsgetinfosfifthscene/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/config.json
...r/sceneProject/bmsgetinfosfirstscene/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/config.json
...eProject/bmsgetinfosfirstsceneupdate/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/config.json
.../sceneProject/bmsgetinfosfourthscene/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/config.json
.../sceneProject/bmsgetinfosscenesystem/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/config.json
.../sceneProject/bmsgetinfosscenevendor/src/main/config.json
+2
-2
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/config.json
...r/sceneProject/bmsgetinfosthirdscene/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneeight/src/main/config.json
...lemanager/sceneProject/bmssceneeight/src/main/config.json
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenenine/src/main/config.json
...dlemanager/sceneProject/bmsscenenine/src/main/config.json
+1
-1
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
+23
-23
utils_lite/kv_store_posix/src/KvStoreTest.cpp
utils_lite/kv_store_posix/src/KvStoreTest.cpp
+7
-7
未找到文件。
aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js
浏览文件 @
a5622796
/*
* Copyright (c) 2021 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.
*/
export
default
{
export
default
{
onCreate
()
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
console
.
info
(
'
AceApplication onCreate
'
);
...
...
aafwk_lite/ability_posix/src/AbilityMgrTest.cpp
浏览文件 @
a5622796
...
@@ -146,7 +146,7 @@ protected:
...
@@ -146,7 +146,7 @@ protected:
bool
uninstallResult
=
false
;
bool
uninstallResult
=
false
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
uninstallResult
=
Uninstall
(
"com.
huawei
.testnative"
,
&
installParam
,
TestBundleStateCallback
);
uninstallResult
=
Uninstall
(
"com.
openharmony
.testnative"
,
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
sem_wait
(
&
g_sem
);
if
(
uninstallResult
)
{
if
(
uninstallResult
)
{
printf
(
"sem exit
\n
"
);
printf
(
"sem exit
\n
"
);
...
@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest, testSetWantElement, Function | MediumTest | Level0)
...
@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest, testSetWantElement, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
if
(
setResult
)
{
if
(
setResult
)
{
EXPECT_STREQ
(
want
.
element
->
deviceId
,
"0001000"
);
EXPECT_STREQ
(
want
.
element
->
deviceId
,
"0001000"
);
EXPECT_STREQ
(
want
.
element
->
abilityName
,
"SecondAbility"
);
EXPECT_STREQ
(
want
.
element
->
abilityName
,
"SecondAbility"
);
EXPECT_STREQ
(
want
.
element
->
bundleName
,
"com.
huawei
.testnative"
);
EXPECT_STREQ
(
want
.
element
->
bundleName
,
"com.
openharmony
.testnative"
);
}
}
}
}
ClearElement
(
&
element
);
ClearElement
(
&
element
);
...
@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest, testWantToUri, Function | MediumTest | Level0)
...
@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest, testWantToUri, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
if
(
setResult
)
{
if
(
setResult
)
{
const
char
*
uri
=
WantToUri
(
want
);
const
char
*
uri
=
WantToUri
(
want
);
printf
(
"uri is %s
\n
"
,
uri
);
printf
(
"uri is %s
\n
"
,
uri
);
const
char
*
expectResult
=
"#Want;device=0001000;bundle=com.
huawei
.testnative;ability=SecondAbility;end"
;
const
char
*
expectResult
=
"#Want;device=0001000;bundle=com.
openharmony
.testnative;ability=SecondAbility;end"
;
EXPECT_STREQ
(
uri
,
expectResult
);
EXPECT_STREQ
(
uri
,
expectResult
);
free
((
void
*
)
uri
);
free
((
void
*
)
uri
);
}
}
...
@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest, testWantParseUri, Function | MediumTest | Level0)
...
@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest, testWantParseUri, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
...
@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest, testGetBundleNameIllegal, Function | MediumTest | Level
...
@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest, testGetBundleNameIllegal, Function | MediumTest | Level
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -468,7 +468,7 @@ HWTEST_F(AbilityMgrTest, testGetSrcPathIllegal, Function | MediumTest | Level1)
...
@@ -468,7 +468,7 @@ HWTEST_F(AbilityMgrTest, testGetSrcPathIllegal, Function | MediumTest | Level1)
printf
(
"------start testGetSrcPathIllegal------
\n
"
);
printf
(
"------start testGetSrcPathIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -489,7 +489,7 @@ HWTEST_F(AbilityMgrTest, testGetDataPathIllegal, Function | MediumTest | Level1)
...
@@ -489,7 +489,7 @@ HWTEST_F(AbilityMgrTest, testGetDataPathIllegal, Function | MediumTest | Level1)
printf
(
"------start testGetDataPathIllegal------
\n
"
);
printf
(
"------start testGetDataPathIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -513,7 +513,7 @@ HWTEST_F(AbilityMgrTest, testDumpIllegal, Function | MediumTest | Level1)
...
@@ -513,7 +513,7 @@ HWTEST_F(AbilityMgrTest, testDumpIllegal, Function | MediumTest | Level1)
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
Ability
*
ability
=
new
Ability
();
Ability
*
ability
=
new
Ability
();
...
@@ -536,7 +536,7 @@ HWTEST_F(AbilityMgrTest, testStartAbility, Function | MediumTest | Level1)
...
@@ -536,7 +536,7 @@ HWTEST_F(AbilityMgrTest, testStartAbility, Function | MediumTest | Level1)
printf
(
"------start testStartAbility------
\n
"
);
printf
(
"------start testStartAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -573,7 +573,7 @@ HWTEST_F(AbilityMgrTest, testStopAbility, Function | MediumTest | Level0)
...
@@ -573,7 +573,7 @@ HWTEST_F(AbilityMgrTest, testStopAbility, Function | MediumTest | Level0)
printf
(
"------start testStopAbility------
\n
"
);
printf
(
"------start testStopAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
g_errorCode
=
StartAbility
(
&
want
);
g_errorCode
=
StartAbility
(
&
want
);
...
@@ -613,7 +613,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbility, Function | MediumTest | Level1)
...
@@ -613,7 +613,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbility, Function | MediumTest | Level1)
printf
(
"------start testConnectAbility------
\n
"
);
printf
(
"------start testConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -643,7 +643,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbility, Function | MediumTest | Level1)
...
@@ -643,7 +643,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbility, Function | MediumTest | Level1)
printf
(
"------start testDisConnectAbility------
\n
"
);
printf
(
"------start testDisConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -675,7 +675,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbilityIllegal, Function | MediumTest | Leve
...
@@ -675,7 +675,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbilityIllegal, Function | MediumTest | Leve
printf
(
"------start testConnectAbilityIllegal------
\n
"
);
printf
(
"------start testConnectAbilityIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
g_errorCode
=
ConnectAbility
(
nullptr
,
&
g_conn
,
this
);
g_errorCode
=
ConnectAbility
(
nullptr
,
&
g_conn
,
this
);
...
@@ -699,7 +699,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbilityIllegal, Function | MediumTest | L
...
@@ -699,7 +699,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbilityIllegal, Function | MediumTest | L
printf
(
"------start testDisConnectAbilityIllegal------
\n
"
);
printf
(
"------start testDisConnectAbilityIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -730,7 +730,7 @@ HWTEST_F(AbilityMgrTest, testTerminateAbility, Function | MediumTest | Level1)
...
@@ -730,7 +730,7 @@ HWTEST_F(AbilityMgrTest, testTerminateAbility, Function | MediumTest | Level1)
printf
(
"------start testTerminateAbility------
\n
"
);
printf
(
"------start testTerminateAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result1
=
StartAbility
(
&
want
);
int
result1
=
StartAbility
(
&
want
);
...
@@ -761,7 +761,7 @@ HWTEST_F(AbilityMgrTest, testWantMatchBundle, Function | MediumTest | Level1)
...
@@ -761,7 +761,7 @@ HWTEST_F(AbilityMgrTest, testWantMatchBundle, Function | MediumTest | Level1)
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementDeviceID
(
&
element
,
""
);
SetElementDeviceID
(
&
element
,
""
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
...
@@ -797,7 +797,7 @@ HWTEST_F(AbilityMgrTest, testWantNotMathBundle, Function | MediumTest | Level2)
...
@@ -797,7 +797,7 @@ HWTEST_F(AbilityMgrTest, testWantNotMathBundle, Function | MediumTest | Level2)
std
::
string
aName
=
"NoThisAbility"
;
std
::
string
aName
=
"NoThisAbility"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.nothishap"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.nothishap"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -826,7 +826,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathBundleName, Function | MediumTest | Lev
...
@@ -826,7 +826,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathBundleName, Function | MediumTest | Lev
std
::
string
aName
=
"Ability"
;
std
::
string
aName
=
"Ability"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -855,7 +855,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathAbility, Function | MediumTest | Level1
...
@@ -855,7 +855,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathAbility, Function | MediumTest | Level1
std
::
string
aName
=
"MainAbility"
;
std
::
string
aName
=
"MainAbility"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.test"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.test"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -883,7 +883,7 @@ HWTEST_F(AbilityMgrTest, testWantDataMatchLength, Function | MediumTest | Level1
...
@@ -883,7 +883,7 @@ HWTEST_F(AbilityMgrTest, testWantDataMatchLength, Function | MediumTest | Level1
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
5
);
SetWantData
(
&
want
,
"test"
,
5
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
...
@@ -916,7 +916,7 @@ HWTEST_F(AbilityMgrTest, testWantDataNotMatchLength, Function | MediumTest | Lev
...
@@ -916,7 +916,7 @@ HWTEST_F(AbilityMgrTest, testWantDataNotMatchLength, Function | MediumTest | Lev
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
3
);
SetWantData
(
&
want
,
"test"
,
3
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
...
aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp
浏览文件 @
a5622796
...
@@ -146,7 +146,7 @@ protected:
...
@@ -146,7 +146,7 @@ protected:
bool
uninstallResult
=
false
;
bool
uninstallResult
=
false
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
uninstallResult
=
Uninstall
(
"com.
huawei
.testnative"
,
&
installParam
,
TestBundleStateCallback
);
uninstallResult
=
Uninstall
(
"com.
openharmony
.testnative"
,
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
sem_wait
(
&
g_sem
);
if
(
uninstallResult
)
{
if
(
uninstallResult
)
{
printf
(
"sem exit
\n
"
);
printf
(
"sem exit
\n
"
);
...
@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest2, testSetWantElement, Function | MediumTest | Level0)
...
@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest2, testSetWantElement, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
if
(
setResult
)
{
if
(
setResult
)
{
EXPECT_STREQ
(
want
.
element
->
deviceId
,
"0001000"
);
EXPECT_STREQ
(
want
.
element
->
deviceId
,
"0001000"
);
EXPECT_STREQ
(
want
.
element
->
abilityName
,
"ServiceAbility"
);
EXPECT_STREQ
(
want
.
element
->
abilityName
,
"ServiceAbility"
);
EXPECT_STREQ
(
want
.
element
->
bundleName
,
"com.
huawei
.testnative"
);
EXPECT_STREQ
(
want
.
element
->
bundleName
,
"com.
openharmony
.testnative"
);
}
}
}
}
ClearElement
(
&
element
);
ClearElement
(
&
element
);
...
@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest2, testWantToUri, Function | MediumTest | Level0)
...
@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest2, testWantToUri, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
SetElementAbilityName
(
&
element
,
"SecondAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
if
(
setResult
)
{
if
(
setResult
)
{
const
char
*
uri
=
WantToUri
(
want
);
const
char
*
uri
=
WantToUri
(
want
);
printf
(
"uri is %s
\n
"
,
uri
);
printf
(
"uri is %s
\n
"
,
uri
);
const
char
*
expectResult
=
"#Want;device=0001000;bundle=com.
huawei
.testnative;ability=SecondAbility;end"
;
const
char
*
expectResult
=
"#Want;device=0001000;bundle=com.
openharmony
.testnative;ability=SecondAbility;end"
;
EXPECT_STREQ
(
uri
,
expectResult
);
EXPECT_STREQ
(
uri
,
expectResult
);
free
((
void
*
)
uri
);
free
((
void
*
)
uri
);
}
}
...
@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest2, testWantParseUri, Function | MediumTest | Level0)
...
@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest2, testWantParseUri, Function | MediumTest | Level0)
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementDeviceID
(
&
element
,
"0001000"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
if
(
element
.
abilityName
!=
nullptr
)
{
if
(
element
.
abilityName
!=
nullptr
)
{
bool
setResult
=
SetWantElement
(
&
want
,
element
);
bool
setResult
=
SetWantElement
(
&
want
,
element
);
...
@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest2, testGetBundleNameIllegal, Function | MediumTest | Leve
...
@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest2, testGetBundleNameIllegal, Function | MediumTest | Leve
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -470,7 +470,7 @@ HWTEST_F(AbilityMgrTest2, testGetSrcPathIllegal, Function | MediumTest | Level1)
...
@@ -470,7 +470,7 @@ HWTEST_F(AbilityMgrTest2, testGetSrcPathIllegal, Function | MediumTest | Level1)
printf
(
"------start testGetSrcPathIllegal------
\n
"
);
printf
(
"------start testGetSrcPathIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -494,7 +494,7 @@ HWTEST_F(AbilityMgrTest2, testGetDataPathIllegal, Function | MediumTest | Level1
...
@@ -494,7 +494,7 @@ HWTEST_F(AbilityMgrTest2, testGetDataPathIllegal, Function | MediumTest | Level1
printf
(
"------start testGetDataPathIllegal------
\n
"
);
printf
(
"------start testGetDataPathIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -520,7 +520,7 @@ HWTEST_F(AbilityMgrTest2, testDumpIllegal, Function | MediumTest | Level1)
...
@@ -520,7 +520,7 @@ HWTEST_F(AbilityMgrTest2, testDumpIllegal, Function | MediumTest | Level1)
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
Ability
*
ability
=
new
Ability
();
Ability
*
ability
=
new
Ability
();
...
@@ -545,7 +545,7 @@ HWTEST_F(AbilityMgrTest2, testStartAbility, Function | MediumTest | Level1)
...
@@ -545,7 +545,7 @@ HWTEST_F(AbilityMgrTest2, testStartAbility, Function | MediumTest | Level1)
printf
(
"------start testStartAbility------
\n
"
);
printf
(
"------start testStartAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
@@ -584,7 +584,7 @@ HWTEST_F(AbilityMgrTest2, testStopAbility, Function | MediumTest | Level0)
...
@@ -584,7 +584,7 @@ HWTEST_F(AbilityMgrTest2, testStopAbility, Function | MediumTest | Level0)
printf
(
"------start testStopAbility------
\n
"
);
printf
(
"------start testStopAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
g_errorCode
=
StartAbility
(
&
want
);
g_errorCode
=
StartAbility
(
&
want
);
...
@@ -624,7 +624,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbility, Function | MediumTest | Level1)
...
@@ -624,7 +624,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbility, Function | MediumTest | Level1)
printf
(
"------start testConnectAbility------
\n
"
);
printf
(
"------start testConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -655,7 +655,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbility, Function | MediumTest | Level1)
...
@@ -655,7 +655,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbility, Function | MediumTest | Level1)
printf
(
"------start testDisConnectAbility------
\n
"
);
printf
(
"------start testDisConnectAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -688,7 +688,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbilityIllegal, Function | MediumTest | Lev
...
@@ -688,7 +688,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbilityIllegal, Function | MediumTest | Lev
printf
(
"------start testConnectAbilityIllegal------
\n
"
);
printf
(
"------start testConnectAbilityIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
g_errorCode
=
ConnectAbility
(
nullptr
,
&
g_conn
,
this
);
g_errorCode
=
ConnectAbility
(
nullptr
,
&
g_conn
,
this
);
...
@@ -712,7 +712,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbilityIllegal, Function | MediumTest |
...
@@ -712,7 +712,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbilityIllegal, Function | MediumTest |
printf
(
"------start testDisConnectAbilityIllegal------
\n
"
);
printf
(
"------start testDisConnectAbilityIllegal------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
...
@@ -744,7 +744,7 @@ HWTEST_F(AbilityMgrTest2, testTerminateAbility, Function | MediumTest | Level1)
...
@@ -744,7 +744,7 @@ HWTEST_F(AbilityMgrTest2, testTerminateAbility, Function | MediumTest | Level1)
printf
(
"------start testTerminateAbility------
\n
"
);
printf
(
"------start testTerminateAbility------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
int
result1
=
StartAbility
(
&
want
);
int
result1
=
StartAbility
(
&
want
);
...
@@ -775,7 +775,7 @@ HWTEST_F(AbilityMgrTest2, testWantMatchBundle, Function | MediumTest | Level1)
...
@@ -775,7 +775,7 @@ HWTEST_F(AbilityMgrTest2, testWantMatchBundle, Function | MediumTest | Level1)
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetElementDeviceID
(
&
element
,
""
);
SetElementDeviceID
(
&
element
,
""
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
...
@@ -815,7 +815,7 @@ HWTEST_F(AbilityMgrTest2, testWantNotMathBundle, Function | MediumTest | Level2)
...
@@ -815,7 +815,7 @@ HWTEST_F(AbilityMgrTest2, testWantNotMathBundle, Function | MediumTest | Level2)
std
::
string
aName
=
"NoThisAbility"
;
std
::
string
aName
=
"NoThisAbility"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.nothishap"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.nothishap"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -848,7 +848,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathBundleName, Function | MediumTest | Le
...
@@ -848,7 +848,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathBundleName, Function | MediumTest | Le
std
::
string
aName
=
"Ability"
;
std
::
string
aName
=
"Ability"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -881,7 +881,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathAbility, Function | MediumTest | Level
...
@@ -881,7 +881,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathAbility, Function | MediumTest | Level
std
::
string
aName
=
"ServiceAbility"
;
std
::
string
aName
=
"ServiceAbility"
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementAbilityName
(
&
element
,
aName
.
c_str
());
SetElementBundleName
(
&
element
,
"com.
huawei
.test"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.test"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
AbilityInfo
),
0
,
sizeof
(
AbilityInfo
));
...
@@ -913,7 +913,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataMatchLength, Function | MediumTest | Level
...
@@ -913,7 +913,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataMatchLength, Function | MediumTest | Level
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
5
);
SetWantData
(
&
want
,
"test"
,
5
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
...
@@ -946,7 +946,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataNotMatchLength, Function | MediumTest | Le
...
@@ -946,7 +946,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataNotMatchLength, Function | MediumTest | Le
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementAbilityName
(
&
element
,
"ServiceAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testnative"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testnative"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
3
);
SetWantData
(
&
want
,
"test"
,
3
);
int
result
=
StartAbility
(
&
want
);
int
result
=
StartAbility
(
&
want
);
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfifthscene/src/main/config.json
浏览文件 @
a5622796
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName5A"
,
"name"
:
"originWidgetName5A"
,
"value"
:
"com.
huawei
.weather.testWidget5A"
"value"
:
"com.
openharmony
.weather.testWidget5A"
}
}
]
]
},
},
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName5B"
,
"name"
:
"originWidgetName5B"
,
"value"
:
"com.
huawei
.weather.testWidget5B"
"value"
:
"com.
openharmony
.weather.testWidget5B"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstscene/src/main/config.json
浏览文件 @
a5622796
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName1"
,
"name"
:
"originWidgetName1"
,
"value"
:
"c
om.huawei
.weather.testWidget1"
"value"
:
"c
com.openharmony
.weather.testWidget1"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfirstsceneupdate/src/main/config.json
浏览文件 @
a5622796
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetNameA1"
,
"name"
:
"originWidgetNameA1"
,
"value"
:
"com.
huawei
.weather.testWidgetA1"
"value"
:
"com.
openharmony
.weather.testWidgetA1"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosfourthscene/src/main/config.json
浏览文件 @
a5622796
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName4A"
,
"name"
:
"originWidgetName4A"
,
"value"
:
"com.
huawei
.weather.testWidget4A"
"value"
:
"com.
openharmony
.weather.testWidget4A"
}
}
]
]
},
},
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName4B"
,
"name"
:
"originWidgetName4B"
,
"value"
:
"com.
huawei
.weather.testWidget4B"
"value"
:
"com.
openharmony
.weather.testWidget4B"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenesystem/src/main/config.json
浏览文件 @
a5622796
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName1S"
,
"name"
:
"originWidgetName1S"
,
"value"
:
"com.
huawei
.weather.testWidget1S"
"value"
:
"com.
openharmony
.weather.testWidget1S"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosscenevendor/src/main/config.json
浏览文件 @
a5622796
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName1V"
,
"name"
:
"originWidgetName1V"
,
"value"
:
"com.
huawei
.weather.testWidget1V"
"value"
:
"com.
openharmony
.weather.testWidget1V"
}
}
]
]
},
},
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName1V2"
,
"name"
:
"originWidgetName1V2"
,
"value"
:
"com.
huawei
.weather.testWidget1V2"
"value"
:
"com.
openharmony
.weather.testWidget1V2"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsgetinfosthirdscene/src/main/config.json
浏览文件 @
a5622796
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName3"
,
"name"
:
"originWidgetName3"
,
"value"
:
"com.
huawei
.weather.testWidget3"
"value"
:
"com.
openharmony
.weather.testWidget3"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneeight/src/main/config.json
浏览文件 @
a5622796
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetName1"
,
"name"
:
"originWidgetName1"
,
"value"
:
"com.
huawei
.weather.testWidget1"
"value"
:
"com.
openharmony
.weather.testWidget1"
}
}
]
]
},
},
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenenine/src/main/config.json
浏览文件 @
a5622796
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
"customizeData"
:
[
"customizeData"
:
[
{
{
"name"
:
"originWidgetNameA1"
,
"name"
:
"originWidgetNameA1"
,
"value"
:
"com.
huawei
.weather.testWidgetA1"
"value"
:
"com.
openharmony
.weather.testWidgetA1"
}
}
]
]
},
},
...
...
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
浏览文件 @
a5622796
...
@@ -83,7 +83,7 @@ protected:
...
@@ -83,7 +83,7 @@ protected:
{
{
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
Uninstall
(
"com.
huawei
.testjsdemo"
,
&
installParam
,
TestBundleStateCallback
);
Uninstall
(
"com.
openharmony
.testjsdemo"
,
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
sem_wait
(
&
g_sem
);
printf
(
"callback uninstallresult is %d
\n
"
,
g_errorCode
);
printf
(
"callback uninstallresult is %d
\n
"
,
g_errorCode
);
EXPECT_EQ
(
g_errorCode
,
0
);
EXPECT_EQ
(
g_errorCode
,
0
);
...
@@ -103,10 +103,10 @@ HWTEST_F(BundleMgrTest, testClearAbilityInfoIllegal, Function | MediumTest | Lev
...
@@ -103,10 +103,10 @@ HWTEST_F(BundleMgrTest, testClearAbilityInfoIllegal, Function | MediumTest | Lev
// abilityInfo is nullptr
// abilityInfo is nullptr
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
memset_s
(
&
abilityInfo
,
sizeof
(
abilityInfo
),
0
,
sizeof
(
abilityInfo
));
memset_s
(
&
abilityInfo
,
sizeof
(
abilityInfo
),
0
,
sizeof
(
abilityInfo
));
abilityInfo
.
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
abilityInfo
.
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
printf
(
"abilityInfo.bundleName is %s
\n
"
,
abilityInfo
.
bundleName
);
printf
(
"abilityInfo.bundleName is %s
\n
"
,
abilityInfo
.
bundleName
);
ClearAbilityInfo
(
nullptr
);
ClearAbilityInfo
(
nullptr
);
EXPECT_STREQ
(
abilityInfo
.
bundleName
,
"com.
huawei
.testjsdemo"
);
EXPECT_STREQ
(
abilityInfo
.
bundleName
,
"com.
openharmony
.testjsdemo"
);
printf
(
"------end testClearAbilityInfoIllegal------
\n
"
);
printf
(
"------end testClearAbilityInfoIllegal------
\n
"
);
}
}
...
@@ -120,11 +120,11 @@ HWTEST_F(BundleMgrTest, testClearBundleInfoIllegal, Function | MediumTest | Leve
...
@@ -120,11 +120,11 @@ HWTEST_F(BundleMgrTest, testClearBundleInfoIllegal, Function | MediumTest | Leve
printf
(
"------start testClearBundleInfoIllegal------
\n
"
);
printf
(
"------start testClearBundleInfoIllegal------
\n
"
);
BundleInfo
bundleInfo
;
BundleInfo
bundleInfo
;
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
bundleInfo
.
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
bundleInfo
.
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
printf
(
"abilityInfo.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"abilityInfo.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
ClearBundleInfo
(
nullptr
);
ClearBundleInfo
(
nullptr
);
printf
(
"abilityInfo.bundleName afterclear is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"abilityInfo.bundleName afterclear is %s
\n
"
,
bundleInfo
.
bundleName
);
EXPECT_STREQ
(
bundleInfo
.
bundleName
,
"com.
huawei
.testjsdemo"
);
EXPECT_STREQ
(
bundleInfo
.
bundleName
,
"com.
openharmony
.testjsdemo"
);
printf
(
"------end testClearBundleInfoIllegal------
\n
"
);
printf
(
"------end testClearBundleInfoIllegal------
\n
"
);
}
}
...
@@ -201,10 +201,10 @@ HWTEST_F(BundleMgrTest, testSetElementBundleName, Function | MediumTest | Level0
...
@@ -201,10 +201,10 @@ HWTEST_F(BundleMgrTest, testSetElementBundleName, Function | MediumTest | Level0
printf
(
"------start testSetElementBundleName------
\n
"
);
printf
(
"------start testSetElementBundleName------
\n
"
);
Want
want
=
{
nullptr
};
Want
want
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
ElementName
element
=
{
nullptr
};
SetElementBundleName
(
&
element
,
"com.
huawei
.testjsdemo"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testjsdemo"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
printf
(
"element is %s
\n
"
,
want
.
element
->
bundleName
);
printf
(
"element is %s
\n
"
,
want
.
element
->
bundleName
);
char
bName
[]
=
"com.
huawei
.testjsdemo"
;
char
bName
[]
=
"com.
openharmony
.testjsdemo"
;
EXPECT_STREQ
(
want
.
element
->
bundleName
,
bName
);
EXPECT_STREQ
(
want
.
element
->
bundleName
,
bName
);
ClearElement
(
&
element
);
ClearElement
(
&
element
);
ClearWant
(
&
want
);
ClearWant
(
&
want
);
...
@@ -439,7 +439,7 @@ HWTEST_F(BundleMgrTest, testBundleMgrInstallBadfile, Function | MediumTest | Lev
...
@@ -439,7 +439,7 @@ HWTEST_F(BundleMgrTest, testBundleMgrInstallBadfile, Function | MediumTest | Lev
HWTEST_F
(
BundleMgrTest
,
testUninstallNullCallback
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testUninstallNullCallback
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testUninstallNullCallback------
\n
"
);
printf
(
"------start testUninstallNullCallback------
\n
"
);
const
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testdemo"
;
const
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testdemo"
;
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
bool
isUninstallSuccess
=
Uninstall
(
bundleName
,
&
installParam
,
nullptr
);
bool
isUninstallSuccess
=
Uninstall
(
bundleName
,
&
installParam
,
nullptr
);
EXPECT_FALSE
(
isUninstallSuccess
);
EXPECT_FALSE
(
isUninstallSuccess
);
...
@@ -477,7 +477,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
...
@@ -477,7 +477,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
sem_wait
(
&
g_sem
);
sem_wait
(
&
g_sem
);
EXPECT_TRUE
(
installResult
);
EXPECT_TRUE
(
installResult
);
sleep
(
1
);
sleep
(
1
);
const
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testnative"
;
const
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testnative"
;
bool
isUninstallSuccess
=
false
;
bool
isUninstallSuccess
=
false
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
bool
uninstallState
=
Uninstall
(
bundleName
,
&
installParam
,
TestBundleStateCallback
);
bool
uninstallState
=
Uninstall
(
bundleName
,
&
installParam
,
TestBundleStateCallback
);
...
@@ -502,7 +502,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
...
@@ -502,7 +502,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
HWTEST_F
(
BundleMgrTest
,
testUninstallErrorName
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testUninstallErrorName
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testUninstallErrorName------
\n
"
);
printf
(
"------start testUninstallErrorName------
\n
"
);
const
char
*
bundleName
=
(
char
*
)
"com.
huawei
.nothisBundleName"
;
const
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.nothisBundleName"
;
bool
isUninstallSuccess
=
false
;
bool
isUninstallSuccess
=
false
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
InstallParam
installParam
=
{
.
installLocation
=
1
,
.
keepData
=
false
};
...
@@ -560,7 +560,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoRight, Function | MediumTest | Level
...
@@ -560,7 +560,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoRight, Function | MediumTest | Level
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testjsdemo"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testjsdemo"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
4
);
SetWantData
(
&
want
,
"test"
,
4
);
AbilityInfo
abilityInfo
;
AbilityInfo
abilityInfo
;
...
@@ -595,7 +595,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
...
@@ -595,7 +595,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
ElementName
element
;
ElementName
element
;
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
memset_s
(
&
element
,
sizeof
(
ElementName
),
0
,
sizeof
(
ElementName
));
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementAbilityName
(
&
element
,
"MainAbility"
);
SetElementBundleName
(
&
element
,
"com.
huawei
.testjsdemo"
);
SetElementBundleName
(
&
element
,
"com.
openharmony
.testjsdemo"
);
SetWantElement
(
&
want
,
element
);
SetWantElement
(
&
want
,
element
);
SetWantData
(
&
want
,
"test"
,
4
);
SetWantData
(
&
want
,
"test"
,
4
);
g_errorCode
=
QueryAbilityInfo
(
&
want
,
nullptr
);
g_errorCode
=
QueryAbilityInfo
(
&
want
,
nullptr
);
...
@@ -625,7 +625,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoRight, Function | MediumTest | Level1)
...
@@ -625,7 +625,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoRight, Function | MediumTest | Level1)
printf
(
"------start testGetBundleInfoRight------
\n
"
);
printf
(
"------start testGetBundleInfoRight------
\n
"
);
BundleInfo
bundleInfo
;
BundleInfo
bundleInfo
;
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
const
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
const
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
int32_t
flags
=
0
;
int32_t
flags
=
0
;
printf
(
"bundleName is %s
\n
"
,
bundleName
);
printf
(
"bundleName is %s
\n
"
,
bundleName
);
sleep
(
2
);
sleep
(
2
);
...
@@ -656,7 +656,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
...
@@ -656,7 +656,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
printf
(
"------start testGetBundleInfoIllegal------
\n
"
);
printf
(
"------start testGetBundleInfoIllegal------
\n
"
);
BundleInfo
bundleInfo
;
BundleInfo
bundleInfo
;
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
memset_s
(
&
bundleInfo
,
sizeof
(
bundleInfo
),
0
,
sizeof
(
bundleInfo
));
const
char
*
bundleName
=
(
char
*
)
"com.
huawei
.nothishap"
;
const
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.nothishap"
;
int32_t
flags
=
0
;
int32_t
flags
=
0
;
// error bundleName
// error bundleName
g_errorCode
=
GetBundleInfo
(
bundleName
,
flags
,
&
bundleInfo
);
g_errorCode
=
GetBundleInfo
(
bundleName
,
flags
,
&
bundleInfo
);
...
@@ -678,7 +678,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
...
@@ -678,7 +678,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
printf
(
"bundleInfo3.codePath is %s
\n
"
,
bundleInfo
.
codePath
);
printf
(
"bundleInfo3.codePath is %s
\n
"
,
bundleInfo
.
codePath
);
EXPECT_TRUE
(
g_errorCode
==
2
);
EXPECT_TRUE
(
g_errorCode
==
2
);
// flags not exit
// flags not exit
g_errorCode
=
GetBundleInfo
(
"com.
huawei
.testjsdemo"
,
2
,
&
bundleInfo
);
g_errorCode
=
GetBundleInfo
(
"com.
openharmony
.testjsdemo"
,
2
,
&
bundleInfo
);
sleep
(
2
);
sleep
(
2
);
printf
(
"bundleInfo3.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"bundleInfo3.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"bundleInfo3.versionCode is %d
\n
"
,
bundleInfo
.
versionCode
);
printf
(
"bundleInfo3.versionCode is %d
\n
"
,
bundleInfo
.
versionCode
);
...
@@ -855,7 +855,7 @@ HWTEST_F(BundleMgrTest, testGetBundleNameForUidWithIllegal, Function | MediumTes
...
@@ -855,7 +855,7 @@ HWTEST_F(BundleMgrTest, testGetBundleNameForUidWithIllegal, Function | MediumTes
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithLegal_0001
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithLegal_0001
,
Function
|
MediumTest
|
Level1
)
{
{
printf
(
"------start testGetBundleSizeWithLegal_0001------
\n
"
);
printf
(
"------start testGetBundleSizeWithLegal_0001------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
EXPECT_GT
(
resultCode
,
0
);
EXPECT_GT
(
resultCode
,
0
);
printf
(
"------end testGetBundleSizeWithLegal_0001------
\n
"
);
printf
(
"------end testGetBundleSizeWithLegal_0001------
\n
"
);
...
@@ -869,8 +869,8 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0001, Function | MediumTest |
...
@@ -869,8 +869,8 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0001, Function | MediumTest |
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithLegal_0002
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithLegal_0002
,
Function
|
MediumTest
|
Level1
)
{
{
printf
(
"------start testGetBundleSizeWithLegal_0002------
\n
"
);
printf
(
"------start testGetBundleSizeWithLegal_0002------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei.testjsdemoBundleNamelengthequalto127
"
\
char
*
bundleName
=
(
char
*
)
"com.
openharmony.testjsdemoBundleNameleng
"
\
"t
estjsdemoBundleNamelengthequalto127testjsdemoBundleNamelengthequalto127testjsde
"
;
"t
hequalto127testjsdemoBundleNamelengthequalto127testjsdemoBundleNamelengthequalto127tes
"
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
string
hapPath
=
g_testPath
+
"testGetBundleNameWithLegal127.hap"
;
string
hapPath
=
g_testPath
+
"testGetBundleNameWithLegal127.hap"
;
...
@@ -894,7 +894,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0002, Function | MediumTest |
...
@@ -894,7 +894,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0002, Function | MediumTest |
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithIllegal_0001
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithIllegal_0001
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testGetBundleSizeWithIllegal_0001------
\n
"
);
printf
(
"------start testGetBundleSizeWithIllegal_0001------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemoBundleNameLength128test"
\
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemoBundleNameLength128test"
\
"jsdemoBundleNameLength128testjsdemoBundleNameLength128testjsdemoBundleNameLength128T"
;
"jsdemoBundleNameLength128testjsdemoBundleNameLength128testjsdemoBundleNameLength128T"
;
EXPECT_EQ
(
strlen
(
bundleName
),
128
);
EXPECT_EQ
(
strlen
(
bundleName
),
128
);
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
...
@@ -925,7 +925,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0002, Function | MediumTest
...
@@ -925,7 +925,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0002, Function | MediumTest
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithIllegal_0003
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testGetBundleSizeWithIllegal_0003
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testGetBundleSizeWithIllegal_0003------
\n
"
);
printf
(
"------start testGetBundleSizeWithIllegal_0003------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei
.nothishap"
;
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.nothishap"
;
// error bundleName
// error bundleName
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
EXPECT_EQ
(
resultCode
,
0
);
EXPECT_EQ
(
resultCode
,
0
);
...
@@ -955,7 +955,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0004, Function | MediumTest
...
@@ -955,7 +955,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0004, Function | MediumTest
HWTEST_F
(
BundleMgrTest
,
testStressConfig_0001
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testStressConfig_0001
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testStressConfig_0001------
\n
"
);
printf
(
"------start testStressConfig_0001------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
for
(
int
i
=
1
;
i
<=
100
;
i
++
)
{
for
(
int
i
=
1
;
i
<=
100
;
i
++
)
{
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
uint32_t
resultCode
=
GetBundleSize
(
bundleName
);
EXPECT_GT
(
resultCode
,
0
);
EXPECT_GT
(
resultCode
,
0
);
...
@@ -971,8 +971,8 @@ HWTEST_F(BundleMgrTest, testStressConfig_0001, Function | MediumTest | Level2)
...
@@ -971,8 +971,8 @@ HWTEST_F(BundleMgrTest, testStressConfig_0001, Function | MediumTest | Level2)
HWTEST_F
(
BundleMgrTest
,
testStressConfig_0002
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
BundleMgrTest
,
testStressConfig_0002
,
Function
|
MediumTest
|
Level2
)
{
{
printf
(
"------start testStressConfig_0002------
\n
"
);
printf
(
"------start testStressConfig_0002------
\n
"
);
char
*
bundleName
=
(
char
*
)
"com.
huawei
.testjsdemo"
;
char
*
bundleName
=
(
char
*
)
"com.
openharmony
.testjsdemo"
;
char
*
bundleName2
=
(
char
*
)
"com.
huawei
.testjsdemoBtestjsdemoB"
;
char
*
bundleName2
=
(
char
*
)
"com.
openharmony
.testjsdemoBtestjsdemoB"
;
sem_init
(
&
g_sem
,
0
,
0
);
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
string
hapPath
=
g_testPath
+
"frequentlyStress.hap"
;
string
hapPath
=
g_testPath
+
"frequentlyStress.hap"
;
...
...
utils_lite/kv_store_posix/src/KvStoreTest.cpp
浏览文件 @
a5622796
...
@@ -36,18 +36,18 @@ protected:
...
@@ -36,18 +36,18 @@ protected:
static
void
SetUpTestCase
(
void
)
static
void
SetUpTestCase
(
void
)
{
{
printf
(
"----------test case with KvStoreTest start-------------
\n
"
);
printf
(
"----------test case with KvStoreTest start-------------
\n
"
);
int
ret
=
mkdir
(
"/storage/com.
huawei
.kv"
,
S_IRUSR
|
S_IWUSR
);
int
ret
=
mkdir
(
"/storage/com.
openharmony
.kv"
,
S_IRUSR
|
S_IWUSR
);
printf
(
"/storage/com.
huawei
.kv ret = %d
\n
"
,
ret
);
printf
(
"/storage/com.
openharmony
.kv ret = %d
\n
"
,
ret
);
ret
=
UtilsSetEnv
(
"/storage/com.
huawei
.kv"
);
ret
=
UtilsSetEnv
(
"/storage/com.
openharmony
.kv"
);
EXPECT_EQ
(
ret
,
0
);
EXPECT_EQ
(
ret
,
0
);
}
}
// TearDownTestCase:测试套清理动作,在最后一个TestCase之后执行
// TearDownTestCase:测试套清理动作,在最后一个TestCase之后执行
static
void
TearDownTestCase
(
void
)
static
void
TearDownTestCase
(
void
)
{
{
int
ret
=
rmdir
(
"/storage/com.
huawei
.kv/kvstore"
);
int
ret
=
rmdir
(
"/storage/com.
openharmony
.kv/kvstore"
);
printf
(
"/storage/com.
huawei
.kv/kvstore ret = %d
\n
"
,
ret
);
printf
(
"/storage/com.
openharmony
.kv/kvstore ret = %d
\n
"
,
ret
);
ret
=
rmdir
(
"/storage/com.
huawei
.kv"
);
ret
=
rmdir
(
"/storage/com.
openharmony
.kv"
);
printf
(
"/storage/com.
huawei
.kv ret = %d
\n
"
,
ret
);
printf
(
"/storage/com.
openharmony
.kv ret = %d
\n
"
,
ret
);
printf
(
"----------test case with KvStoreTest end-------------
\n
"
);
printf
(
"----------test case with KvStoreTest end-------------
\n
"
);
}
}
// 用例的预置动作
// 用例的预置动作
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录