diff --git a/services/distributeddataservice/service/test/udmf_run_time_store_test.cpp b/services/distributeddataservice/service/test/udmf_run_time_store_test.cpp index 1c92a86a6957afd7110357ab9691490c1581537c..e583704c3099d37528cd3ffba42fc4fb67f4a5e7 100644 --- a/services/distributeddataservice/service/test/udmf_run_time_store_test.cpp +++ b/services/distributeddataservice/service/test/udmf_run_time_store_test.cpp @@ -93,6 +93,7 @@ public: const uint32_t MAX_VALUE_SIZE = 4 * 1024 * 1024; const std::string STORE_ID = "drag"; const std::string KEY_PREFIX = "TEST_"; + const std::string SUMMARY_KEY_PREFIX = "SUMMARY_KEY_PREFIX"; const std::string EMPTY_DEVICE_ID = ""; const std::string BUNDLE_NAME = "udmf_test"; static constexpr size_t tempUdataRecordSize = 1; @@ -643,9 +644,19 @@ HWTEST_F(UdmfRunTimeStoreTest, GetSummary, TestSize.Level1) bool result = store->Init(); EXPECT_TRUE(result); Summary summary; - UnifiedKey key(KEY_PREFIX); - auto status = store->GetSummary(key, summary); - ASSERT_EQ(status, E_NOT_FOUND); + summary.summary = { + { "general.file", 10 }, + { "general.png", 10 }, + { "general.html", 10 }, + { "general.jpeg", 10 }, + { "general.avi", 10}, + { "aabbcc", 10} + }; + UnifiedKey key(SUMMARY_KEY_PREFIX); + auto status = store->PutSummary(key, summary); + EXPECT_EQ(status, E_OK); + status = store->GetSummary(key, summary); + ASSERT_EQ(status, E_OK); } /** diff --git a/services/distributeddataservice/service/test/udmf_service_impl_mock_test.cpp b/services/distributeddataservice/service/test/udmf_service_impl_mock_test.cpp index 9c7e3c2dbb9b35715e3690df2f43a04efef3980d..9daa166f47cbbd23c181584e9c5ac1e53bf42881 100644 --- a/services/distributeddataservice/service/test/udmf_service_impl_mock_test.cpp +++ b/services/distributeddataservice/service/test/udmf_service_impl_mock_test.cpp @@ -93,7 +93,7 @@ HWTEST_F(UdmfServiceImplMockTest, IsNeedMetaSyncTest001, TestSize.Level0) .WillOnce(Return(true)) .WillOnce(Return(true)); isNeedSync = udmfServiceImpl.IsNeedMetaSync(meta, devices); - EXPECT_EQ(isNeedSync, false); + EXPECT_EQ(isNeedSync, true); } /**