From 55cc151e5e8ad5080cd43717390ead2162bfaf9d Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Fri, 22 Aug 2025 18:09:32 +0800 Subject: [PATCH] =?UTF-8?q?enablecloud=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang --- .../service/cloud/cloud_service_impl.cpp | 5 +++++ .../service/test/cloud_data_test.cpp | 22 ++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/services/distributeddataservice/service/cloud/cloud_service_impl.cpp b/services/distributeddataservice/service/cloud/cloud_service_impl.cpp index 75c4ae326..036d7dda6 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: -- Gitee