diff --git a/packing_tool/frameworks/test/unittest/app_packager_test/app_packager_test.cpp b/packing_tool/frameworks/test/unittest/app_packager_test/app_packager_test.cpp index 249f49391fd8397bc9c41f62b5b89ddaf328a641..173e5b28e1ff3af3f3c9ef720dcaed41a68d5de0 100644 --- a/packing_tool/frameworks/test/unittest/app_packager_test/app_packager_test.cpp +++ b/packing_tool/frameworks/test/unittest/app_packager_test/app_packager_test.cpp @@ -1138,4 +1138,92 @@ HWTEST_F(AppPackagerTest, CompressAppMode_6200, Function | MediumTest | Level1) MockModuleJsonUtils::MockCheckHapsIsValid(false); EXPECT_FALSE(appPackager.CompressAppMode()); } + +/* + * @tc.name: GetAndCheckOutPath_6300 + * @tc.desc: GetAndCheckOutPath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, GetAndCheckOutPath_6300, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + std::string outPath; + EXPECT_FALSE(appPackager.GetAndCheckOutPath(outPath)); +} + +/* + * @tc.name: GetAndCheckHapPathAndHspPath_6400 + * @tc.desc: GetAndCheckHapPathAndHspPath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, GetAndCheckHapPathAndHspPath_6400, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + std::string hapPath; + std::string hspPath; + EXPECT_FALSE(appPackager.GetAndCheckHapPathAndHspPath(hapPath, hspPath)); +} + +/* + * @tc.name: GetAndCheckPackInfoPath_6500 + * @tc.desc: GetAndCheckPackInfoPath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, GetAndCheckPackInfoPath_6500, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + std::string packInfoPath; + EXPECT_FALSE(appPackager.GetAndCheckPackInfoPath(packInfoPath)); +} + +/* + * @tc.name: CheckSignaturePath_6600 + * @tc.desc: CheckSignaturePath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, CheckSignaturePath_6600, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + EXPECT_TRUE(appPackager.CheckSignaturePath()); +} + +/* + * @tc.name: CheckCertificatePath_6700 + * @tc.desc: CheckCertificatePath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, CheckCertificatePath_6700, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + EXPECT_TRUE(appPackager.CheckCertificatePath()); +} + +/* + * @tc.name: CheckPackResPath_6800 + * @tc.desc: CheckPackResPath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(AppPackagerTest, CheckPackResPath_6800, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::AppPackager appPackager(parameterMap, resultReceiver); + EXPECT_TRUE(appPackager.CheckPackResPath()); +} } // namespace OHOS \ No newline at end of file diff --git a/packing_tool/frameworks/test/unittest/multiapp_packager_test/multiapp_packager_test.cpp b/packing_tool/frameworks/test/unittest/multiapp_packager_test/multiapp_packager_test.cpp index 7066699d6a708633a96ab1967afe8a44f1b4445b..951418c2def4e6d99df2db4e6e78b85436a90192 100644 --- a/packing_tool/frameworks/test/unittest/multiapp_packager_test/multiapp_packager_test.cpp +++ b/packing_tool/frameworks/test/unittest/multiapp_packager_test/multiapp_packager_test.cpp @@ -991,4 +991,70 @@ HWTEST_F(MultiAppPackagerTest, CompressAppModeForMultiProject_0400, Function | M EXPECT_FALSE(multiAppPackager.CompressAppModeForMultiProject()); fs::remove_all(tempDir); } + +/* + * @tc.name: GetAndCheckOutPath_0100 + * @tc.desc: GetAndCheckOutPath. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MultiAppPackagerTest, GetAndCheckOutPath_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap = {}; + OHOS::AppPackingTool::MultiAppPackager multiAppPackager(parameterMap, resultReceiver); + std::string outPath; + EXPECT_FALSE(multiAppPackager.GetAndCheckOutPath(outPath)); +} + +/* + * @tc.name: GetAndCheckHapAndHspAndAppListStr_0100 + * @tc.desc: GetAndCheckHapAndHspAndAppListStr. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MultiAppPackagerTest, GetAndCheckHapAndHspAndAppListStr_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap = {}; + OHOS::AppPackingTool::MultiAppPackager multiAppPackager(parameterMap, resultReceiver); + std::string hapListStr; + std::string hspListStr; + std::string appListStr; + EXPECT_FALSE(multiAppPackager.GetAndCheckHapAndHspAndAppListStr(hapListStr, hspListStr, appListStr)); +} + +/* + * @tc.name: GetJsonInZips_0100 + * @tc.desc: GetJsonInZips. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MultiAppPackagerTest, GetJsonInZips_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap = {}; + OHOS::AppPackingTool::MultiAppPackager multiAppPackager(parameterMap, resultReceiver); + std::string filePath; + std::string jsonName; + EXPECT_TRUE(multiAppPackager.GetJsonInZips(filePath, jsonName).empty()); +} + +/* + * @tc.name: SelectHapInApp_0100 + * @tc.desc: SelectHapInApp. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(MultiAppPackagerTest, SelectHapInApp_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap = {}; + OHOS::AppPackingTool::MultiAppPackager multiAppPackager(parameterMap, resultReceiver); + std::string appPath("/data/test/resource/packingtool/test_file/multiApp/hap/multiappPackagerHapTest.hap"); + std::list selectedHaps; + std::string tempDir("/data/test/resource/packingtool/"); + std::string finalAppPackInfo; + EXPECT_TRUE(multiAppPackager.SelectHapInApp(appPath, selectedHaps, tempDir, finalAppPackInfo).empty()); +} } // namespace OHOS \ No newline at end of file diff --git a/packing_tool/frameworks/test/unittest/package_normalize_test/package_normalize_test.cpp b/packing_tool/frameworks/test/unittest/package_normalize_test/package_normalize_test.cpp index 3097cf77ac8cd233aabc65c74a4e785022b03afd..8f57d19aeca561609f1d7af7011d0d329275bdbf 100644 --- a/packing_tool/frameworks/test/unittest/package_normalize_test/package_normalize_test.cpp +++ b/packing_tool/frameworks/test/unittest/package_normalize_test/package_normalize_test.cpp @@ -674,4 +674,32 @@ HWTEST_F(PackageNormalizeTest, ModifyPackInfo_1900, Function | MediumTest | Leve cmd << "rm -rf " << OUT_PATH; system(cmd.str().c_str()); } + +/* + * @tc.name: PostProcess_0100 + * @tc.desc: PostProcess. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(PackageNormalizeTest, PostProcess_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::PackageNormalize packageNormalize(parameterMap, resultReceiver); + EXPECT_EQ(packageNormalize.PostProcess(), 0); +} + +/* + * @tc.name: InitAllowedParam_0100 + * @tc.desc: InitAllowedParam. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(PackageNormalizeTest, InitAllowedParam_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap; + OHOS::AppPackingTool::PackageNormalize packageNormalize(parameterMap, resultReceiver); + EXPECT_EQ(packageNormalize.InitAllowedParam(), 0); +} } // namespace OHOS \ No newline at end of file diff --git a/packing_tool/frameworks/test/unittest/version_normalize_test/version_normalize_test.cpp b/packing_tool/frameworks/test/unittest/version_normalize_test/version_normalize_test.cpp index a7f5246a74fcb5f651c006b6602ec90c15ace43c..f4d564b77b1b99f59d3e5bf5e9c21ec137c7a357 100644 --- a/packing_tool/frameworks/test/unittest/version_normalize_test/version_normalize_test.cpp +++ b/packing_tool/frameworks/test/unittest/version_normalize_test/version_normalize_test.cpp @@ -634,4 +634,18 @@ HWTEST_F(VersionNormalizeTest, Process_0100, Function | MediumTest | Level1) EXPECT_EQ(versionNormalize.PostProcess(), 0); system("rm -rf /data/test/versionnormalize_packing"); } + +/* + * @tc.name: InitAllowedParam_0100 + * @tc.desc: InitAllowedParam. + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(VersionNormalizeTest, InitAllowedParam_0100, Function | MediumTest | Level1) +{ + std::string resultReceiver; + std::map parameterMap = {}; + OHOS::AppPackingTool::VersionNormalize versionNormalize(parameterMap, resultReceiver); + EXPECT_EQ(versionNormalize.InitAllowedParam(), 0); +} } // namespace OHOS \ No newline at end of file