diff --git a/services/distributeddataservice/service/cloud/cloud_service_impl.cpp b/services/distributeddataservice/service/cloud/cloud_service_impl.cpp index 75c4ae3266a401445ff582be5ccb7cb7554a59f1..036d7dda64185461d9541fda0df201d8a5aed11e 100644 --- a/services/distributeddataservice/service/cloud/cloud_service_impl.cpp +++ b/services/distributeddataservice/service/cloud/cloud_service_impl.cpp @@ -133,6 +133,11 @@ int32_t CloudServiceImpl::EnableCloud(const std::string &id, const std::map switches; @@ -1418,6 +1418,22 @@ HWTEST_F(CloudDataTest, EnableCloud, TestSize.Level0) EXPECT_EQ(ret, CloudData::CloudService::SUCCESS); } +/** +* @tc.name: EnableCloud02 +* @tc.desc: Test the EnableCloud function to ensure that the id in cloudinfo does not equal the passed id. +* @tc.type: FUNC +* @tc.require: + */ +HWTEST_F(CloudDataTest, EnableCloud02, TestSize.Level0) +{ + std::string bundleName = "testName"; + std::map switches; + switches.insert_or_assign(TEST_CLOUD_BUNDLE, CloudData::CloudService::SWITCH_ON); + switches.insert_or_assign(bundleName, CloudData::CloudService::SWITCH_ON); + auto ret = cloudServiceImpl_->EnableCloud("123456", switches); + EXPECT_NE(ret, CloudData::CloudService::SUCCESS); +} + /** * @tc.name: OnEnableCloud * @tc.desc: