Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d6a589dc
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看板
提交
d6a589dc
编写于
10月 28, 2021
作者:
胡
胡永延
提交者:
Gitee
10月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update appexecfwk_lite/bundle_mgr_posix/src/BundleMgrTest.cpp.
上级
724f75a9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
appexecfwk_lite/bundle_mgr_posix/src/BundleMgrTest.cpp
appexecfwk_lite/bundle_mgr_posix/src/BundleMgrTest.cpp
+15
-15
未找到文件。
appexecfwk_lite/bundle_mgr_posix/src/BundleMgrTest.cpp
浏览文件 @
d6a589dc
...
@@ -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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录