diff --git a/test/unittest/ability_keep_alive_data_manager_second_test/ability_keep_alive_data_manager_second_test.cpp b/test/unittest/ability_keep_alive_data_manager_second_test/ability_keep_alive_data_manager_second_test.cpp index 8f478844ac7fdcb3f894006d021d341e1a184fec..caebe65a2797b656cb07cdf1307b704755dace32 100644 --- a/test/unittest/ability_keep_alive_data_manager_second_test/ability_keep_alive_data_manager_second_test.cpp +++ b/test/unittest/ability_keep_alive_data_manager_second_test/ability_keep_alive_data_manager_second_test.cpp @@ -432,7 +432,7 @@ HWTEST_F(AbilityKeepAliveDataManagerTest, QueryKeepAliveApplications_300, TestSi int32_t result = abilityKeepAliveDataManager.QueryKeepAliveApplications(params, infoList); EXPECT_EQ(result, ERR_NO_INIT); - GTEST_LOG_(INFO) << "QueryKeepAliveData_300 end"; + GTEST_LOG_(INFO) << "QueryKeepAliveApplications_300 end"; } /** @@ -458,7 +458,7 @@ HWTEST_F(AbilityKeepAliveDataManagerTest, QueryKeepAliveApplications_400, TestSi abilityKeepAliveDataManager.kvStorePtr_ = kvStorePtr; int32_t result = abilityKeepAliveDataManager.QueryKeepAliveApplications(params, infoList); EXPECT_EQ(result, ERR_INVALID_OPERATION); - GTEST_LOG_(INFO) << "QueryKeepAliveData_400 end"; + GTEST_LOG_(INFO) << "QueryKeepAliveApplications_400 end"; } /** @@ -582,7 +582,7 @@ HWTEST_F(AbilityKeepAliveDataManagerTest, ConvertKeepAliveInfoFromKey_100, TestS */ HWTEST_F(AbilityKeepAliveDataManagerTest, ConvertKeepAliveInfoFromKey_200, TestSize.Level1) { - GTEST_LOG_(INFO) << "ConvertKeepAliveInfoFromKey_100 start"; + GTEST_LOG_(INFO) << "ConvertKeepAliveInfoFromKey_200 start"; KeepAliveInfo info; DistributedKv::Key key = "invalid_key"; AbilityKeepAliveDataManager abilityKeepAliveDataManager; @@ -591,7 +591,7 @@ HWTEST_F(AbilityKeepAliveDataManagerTest, ConvertKeepAliveInfoFromKey_200, TestS EXPECT_EQ(retInfo.userId, info.userId); EXPECT_EQ(retInfo.appType, info.appType); EXPECT_EQ(retInfo.setter, info.setter); - GTEST_LOG_(INFO) << "ConvertKeepAliveInfoFromKey_100 end"; + GTEST_LOG_(INFO) << "ConvertKeepAliveInfoFromKey_200 end"; } /** diff --git a/test/unittest/ability_manager_service_thirteenth_test/ability_manager_service_thirteenth_test.cpp b/test/unittest/ability_manager_service_thirteenth_test/ability_manager_service_thirteenth_test.cpp index c545680f5bc3da897c5d484e2aa6629aeca24bc7..0bb1b2208a44e500bb48e92470f84c417f4af6b5 100644 --- a/test/unittest/ability_manager_service_thirteenth_test/ability_manager_service_thirteenth_test.cpp +++ b/test/unittest/ability_manager_service_thirteenth_test/ability_manager_service_thirteenth_test.cpp @@ -262,7 +262,7 @@ HWTEST_F(AbilityManagerServiceThirteenthTest, CheckUIExtensionCallerIsForeground auto abilityMs_ = std::make_shared(); EXPECT_NE(abilityMs_, nullptr); AbilityRequest abilityRequest; - int result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); + bool result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); EXPECT_TRUE(result); TAG_LOGI(AAFwkTag::TEST, "AbilityManagerServiceThirteenthTest CheckUIExtensionCallerIsForeground_001 end"); } @@ -284,7 +284,7 @@ HWTEST_F(AbilityManagerServiceThirteenthTest, CheckUIExtensionCallerIsForeground abilityRequest.abilityInfo.name = "MainAbility"; abilityRequest.abilityInfo.type = AbilityType::PAGE; MyStatus::GetInstance().permPermission_ = 0; - int result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); + bool result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); EXPECT_TRUE(result); TAG_LOGI(AAFwkTag::TEST, "AbilityManagerServiceThirteenthTest CheckUIExtensionCallerIsForeground_002 end"); } @@ -306,7 +306,7 @@ HWTEST_F(AbilityManagerServiceThirteenthTest, CheckUIExtensionCallerIsForeground abilityRequest.abilityInfo.name = "MainAbility"; abilityRequest.abilityInfo.type = AbilityType::PAGE; MyStatus::GetInstance().permPermission_ = 1; - int result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); + bool result = abilityMs_->CheckUIExtensionCallerIsForeground(abilityRequest); EXPECT_TRUE(result); TAG_LOGI(AAFwkTag::TEST, "AbilityManagerServiceThirteenthTest CheckUIExtensionCallerIsForeground_003 end"); } diff --git a/test/unittest/ability_manager_service_thirteenth_test/mock/include/mock_parameters.h b/test/unittest/ability_manager_service_thirteenth_test/mock/include/mock_parameters.h index 2fa291f7d99d8707788687c8c9976645d5980e2a..0e6e026ca8f83ccf9d398d1022a9d31c0462f1e3 100644 --- a/test/unittest/ability_manager_service_thirteenth_test/mock/include/mock_parameters.h +++ b/test/unittest/ability_manager_service_thirteenth_test/mock/include/mock_parameters.h @@ -28,4 +28,4 @@ bool GetBoolParameter(const std::string& key, bool def); } // namespace system } // namespace OHOS -#endif // MOCK_PARAMETERS_H +#endif // SYSTEM_PARAMETERS_H diff --git a/test/unittest/app_preloader_test/include/bundle_mgr_helper.h b/test/unittest/app_preloader_test/include/bundle_mgr_helper.h index 86b808d8a5a12fc8713ceea3f587f26995ade26b..d7bcca2ae98f34a08f99f672ae856b5d3614efe8 100644 --- a/test/unittest/app_preloader_test/include/bundle_mgr_helper.h +++ b/test/unittest/app_preloader_test/include/bundle_mgr_helper.h @@ -53,7 +53,6 @@ public: switch (userId) { case UID_CHECK_FALSE: return false; - break; case UID_CHECK_PRELOAD_SERVICE: abilityInfo.type = AppExecFwk::AbilityType::SERVICE; abilityInfo.isStageBasedModel = true; diff --git a/test/unittest/exit_resident_process_manager_test/exit_resident_process_manager_test.cpp b/test/unittest/exit_resident_process_manager_test/exit_resident_process_manager_test.cpp index 0ed1254ab24341d41794714411243acf374b9505..3f09fb40847cb27ab01130b97bc0587da51267e3 100644 --- a/test/unittest/exit_resident_process_manager_test/exit_resident_process_manager_test.cpp +++ b/test/unittest/exit_resident_process_manager_test/exit_resident_process_manager_test.cpp @@ -170,11 +170,11 @@ HWTEST_F(ExitResidentProcessManagerTest, IsKilledForUpgradeWeb_001, TestSize.Lev } /** - * @tc.name: IsMemorySizeSufficient_001 + * @tc.name: IsMemorySizeSufficient_002 * @tc.desc: Verify that the IsMemorySizeSufficient interface calls normally * @tc.type: FUNC */ -HWTEST_F(ExitResidentProcessManagerTest, IsMemorySizeSufficient_001, TestSize.Level1) +HWTEST_F(ExitResidentProcessManagerTest, IsMemorySizeSufficient_002, TestSize.Level1) { auto exitResidentProcessManager = std::make_shared(); exitResidentProcessManager->currentBigMemoryState_ = MemoryState::MEMORY_RECOVERY; diff --git a/test/unittest/insight_intent/insight_intent_execute_manager_second_test/insight_intent_execute_manager_second_test.cpp b/test/unittest/insight_intent/insight_intent_execute_manager_second_test/insight_intent_execute_manager_second_test.cpp index dce151ba6d25593546b654f8a153802c6dbb358d..30268e680bb49e5eda3bb815b131a0a8eee0c729 100644 --- a/test/unittest/insight_intent/insight_intent_execute_manager_second_test/insight_intent_execute_manager_second_test.cpp +++ b/test/unittest/insight_intent/insight_intent_execute_manager_second_test/insight_intent_execute_manager_second_test.cpp @@ -25,7 +25,7 @@ using namespace testing; using namespace testing::ext; namespace { -constexpr uint64_t NON_EXIST_ID = 12345; + constexpr uint64_t NON_EXIST_ID = 12345; }; namespace OHOS { namespace AAFwk { @@ -470,75 +470,6 @@ HWTEST_F(InsightIntentExecuteManagerSecondTest, GetBundleName_0200, TestSize.Lev TAG_LOGI(AAFwkTag::TEST, "end."); } -/** - * @tc.name: GenerateWant_0300 - * @tc.desc: GenerateWant_0300 - * @tc.type: FUNC - * @tc.require: issueI8ZRAG - */ -HWTEST_F(InsightIntentExecuteManagerSecondTest, GenerateWant_0300, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "begin."); - AbilityRuntime::ExtractInsightIntentGenericInfo decoratorInfo; - Want want; - auto ret = InsightIntentExecuteManager::GenerateWant(nullptr, decoratorInfo, want); - EXPECT_EQ(ret, ERR_INVALID_VALUE); - TAG_LOGI(AAFwkTag::TEST, "end."); -} - -/** - * @tc.name: GenerateWant_0400 - * @tc.desc: GenerateWant_0400 - * @tc.type: FUNC - * @tc.require: issueI8ZRAG - */ -HWTEST_F(InsightIntentExecuteManagerSecondTest, GenerateWant_0400, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "begin."); - AppExecFwk::InsightIntentExecuteParam param; - param.bundleName_ = "test.bundleName"; - param.moduleName_ = "test.entry"; - param.abilityName_ = "test.abilityName"; - param.insightIntentName_ = ""; - param.insightIntentParam_ = nullptr; - param.displayId_ = 2; - param.executeMode_ = AppExecFwk::ExecuteMode::UI_ABILITY_FOREGROUND; - auto paramPtr = std::make_shared(param); - Want want; - std::string startTime = want.GetStringParam(Want::PARAM_RESV_START_TIME); - EXPECT_TRUE(startTime.empty()); - AbilityRuntime::ExtractInsightIntentGenericInfo decoratorInfo; - InsightIntentExecuteManager::GenerateWant(paramPtr, decoratorInfo, want); - startTime = want.GetStringParam(Want::PARAM_RESV_START_TIME); - EXPECT_FALSE(startTime.empty()); - TAG_LOGI(AAFwkTag::TEST, "end."); -} - -/** - * @tc.name: GenerateWant_0500 - * @tc.desc: GenerateWant_0500 - * @tc.type: FUNC - * @tc.require: issueI8ZRAG - */ -HWTEST_F(InsightIntentExecuteManagerSecondTest, GenerateWant_0500, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "begin."); - AppExecFwk::InsightIntentExecuteParam param; - param.bundleName_ = "test.bundleName"; - param.moduleName_ = "test.entry"; - param.abilityName_ = "test.abilityName"; - param.insightIntentName_ = "test.IntentName"; - param.insightIntentParam_ = nullptr; - param.displayId_ = 2; - param.executeMode_ = AppExecFwk::ExecuteMode::UI_ABILITY_BACKGROUND; - auto paramPtr = std::make_shared(param); - AbilityRuntime::ExtractInsightIntentGenericInfo decoratorInfo; - Want want; - int32_t result = InsightIntentExecuteManager::GenerateWant(paramPtr, decoratorInfo, want); - EXPECT_EQ(result, ERR_INVALID_VALUE); - TAG_LOGI(AAFwkTag::TEST, "end."); -} - /** * @tc.name: CheckIntentIsExemption_0100 * @tc.desc: CheckIntentIsExemption_0100 diff --git a/test/unittest/insight_intent/insight_intent_execute_param_second_test/insight_intent_execute_param_second_test.cpp b/test/unittest/insight_intent/insight_intent_execute_param_second_test/insight_intent_execute_param_second_test.cpp index 817b54620c088fa7e6a841545fe28c0018ab9063..ed3e14ca48c748d89129e3c9ef5099cb0a5fe510 100644 --- a/test/unittest/insight_intent/insight_intent_execute_param_second_test/insight_intent_execute_param_second_test.cpp +++ b/test/unittest/insight_intent/insight_intent_execute_param_second_test/insight_intent_execute_param_second_test.cpp @@ -31,7 +31,7 @@ namespace AAFwk { using InsightIntentExecuteParam = AppExecFwk::InsightIntentExecuteParam; namespace { -const std::string TEST_INSIGHT_INTENT_NANE = "PlayMusic"; +const std::string TEST_INSIGHT_INTENT_NAME = "PlayMusic"; } class InsightIntentExecuteParamSecondTest : public testing::Test { @@ -195,7 +195,7 @@ HWTEST_F(InsightIntentExecuteParamSecondTest, IsInsightIntentPage_0200, TestSize { TAG_LOGI(AAFwkTag::TEST, "begin."); WantParams wantParams; - wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_EXECUTE_PARAM_NAME, AAFwk::String::Box(TEST_INSIGHT_INTENT_NANE)); + wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_EXECUTE_PARAM_NAME, AAFwk::String::Box(TEST_INSIGHT_INTENT_NAME)); wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_DECORATOR_TYPE, AAFwk::Integer::Box(static_cast(AbilityRuntime::InsightIntentType::DECOR_PAGE))); Want want; @@ -216,7 +216,7 @@ HWTEST_F(InsightIntentExecuteParamSecondTest, IsInsightIntentPage_0300, TestSize { TAG_LOGI(AAFwkTag::TEST, "begin."); WantParams wantParams; - wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_EXECUTE_PARAM_NAME, AAFwk::String::Box(TEST_INSIGHT_INTENT_NANE)); + wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_EXECUTE_PARAM_NAME, AAFwk::String::Box(TEST_INSIGHT_INTENT_NAME)); wantParams.SetParam(AppExecFwk::INSIGHT_INTENT_DECORATOR_TYPE, AAFwk::String::Box(std::to_string(static_cast((AbilityRuntime::InsightIntentType::DECOR_NONE))))); Want want; diff --git a/test/unittest/update_caller_info_util_test/update_caller_info_util_test.cpp b/test/unittest/update_caller_info_util_test/update_caller_info_util_test.cpp index a2ad17cbe3824ef3a404d304168f0722652d49ab..923db6aed72c10ecd30a3ac5d06ce2afef6a9227 100644 --- a/test/unittest/update_caller_info_util_test/update_caller_info_util_test.cpp +++ b/test/unittest/update_caller_info_util_test/update_caller_info_util_test.cpp @@ -185,12 +185,12 @@ HWTEST_F(UpdateCallerInfoUtilTest, UpdateAsCallerInfoFromDialog_0001, TestSize.L Want want; const std::string TEST_DIALOG_SESSION_ID = "dialogSessionId"; want.SetParam(KEY_REQUEST_ID, std::string("1234567890")); - sptr dilogSessionInfo = nullptr; + sptr dialogSessionInfo = nullptr; std::shared_ptr dialogCallerInfo = std::make_shared(); EXPECT_NE(dialogCallerInfo, nullptr); dialogCallerInfo->targetWant = want; - dialogSessionManager.SetDialogSessionInfo(TEST_DIALOG_SESSION_ID, dilogSessionInfo, dialogCallerInfo); + dialogSessionManager.SetDialogSessionInfo(TEST_DIALOG_SESSION_ID, dialogSessionInfo, dialogCallerInfo); auto callerInfo = dialogSessionManager.GetDialogCallerInfo(TEST_DIALOG_SESSION_ID); EXPECT_NE(dialogSessionManager.GetDialogCallerInfo(TEST_DIALOG_SESSION_ID), nullptr);