diff --git a/services/distributeddataservice/framework/include/snapshot/snapshot.h b/services/distributeddataservice/framework/include/snapshot/snapshot.h index 8a9fa7eef25338ffde134d0fa883dc2ffe32d085..8c1e46d5ed50e562157e0f894259365a24a283a1 100644 --- a/services/distributeddataservice/framework/include/snapshot/snapshot.h +++ b/services/distributeddataservice/framework/include/snapshot/snapshot.h @@ -45,10 +45,6 @@ public: virtual bool IsBoundAsset(const Asset& asset) = 0; }; - -struct BindAssets { - std::shared_ptr>> bindAssets; -}; } // namespace DistributedData } // namespace OHOS #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_SNAPSHOT_H diff --git a/services/distributeddataservice/service/rdb/rdb_asset_loader.cpp b/services/distributeddataservice/service/rdb/rdb_asset_loader.cpp index 801af00ce94099cec643d0ade03a341ace4ead3f..00059689644670f3cd15b785bd2fea6558a7e5dc 100644 --- a/services/distributeddataservice/service/rdb/rdb_asset_loader.cpp +++ b/services/distributeddataservice/service/rdb/rdb_asset_loader.cpp @@ -27,8 +27,8 @@ using namespace DistributedDB; using ValueProxy = OHOS::DistributedData::ValueProxy; namespace OHOS::DistributedRdb { -RdbAssetLoader::RdbAssetLoader(std::shared_ptr cloudAssetLoader, BindAssets* bindAssets) - : assetLoader_(std::move(cloudAssetLoader)), snapshots_(bindAssets) +RdbAssetLoader::RdbAssetLoader(std::shared_ptr cloudAssetLoader, BindAssets bindAssets) + : assetLoader_(std::move(cloudAssetLoader)), snapshots_(std::move(bindAssets)) { } @@ -169,11 +169,11 @@ void RdbAssetLoader::PostEvent(DistributedData::AssetEvent eventId, DistributedD deleteAssets.insert(downLoadAsset.uri); continue; } - if (snapshots_ == nullptr || snapshots_->bindAssets == nullptr) { + if (snapshots_ == nullptr) { continue; } - auto it = snapshots_->bindAssets->find(downLoadAsset.uri); - if (it == snapshots_->bindAssets->end() || it->second == nullptr) { + auto it = snapshots_->find(downLoadAsset.uri); + if (it == snapshots_->end() || it->second == nullptr) { continue; } auto snapshot = it->second; @@ -185,7 +185,7 @@ void RdbAssetLoader::PostEvent(DistributedData::AssetEvent eventId, DistributedD } else { auto skipPos = skipAssets.find(downLoadAsset.uri); auto deletePos = deleteAssets.find(downLoadAsset.uri); - if (skipPos != skipAssets.end() || deletePos != skipAssets.end()) { + if (skipPos != skipAssets.end() || deletePos != deleteAssets.end()) { continue; } snapshot->Downloaded(downLoadAsset); diff --git a/services/distributeddataservice/service/rdb/rdb_asset_loader.h b/services/distributeddataservice/service/rdb/rdb_asset_loader.h index 1eb7b3e759c0146286eca196c37f8533d0debc1a..2e05a0abefed1cb21127b49bdf0f55ec45a9676f 100644 --- a/services/distributeddataservice/service/rdb/rdb_asset_loader.h +++ b/services/distributeddataservice/service/rdb/rdb_asset_loader.h @@ -23,18 +23,19 @@ #include "snapshot/snapshot.h" namespace OHOS::DistributedRdb { +using Snapshot = DistributedData::Snapshot; +using BindAssets = std::shared_ptr>>; class RdbAssetLoader : public DistributedDB::IAssetLoader { public: using Type = DistributedDB::Type; using Asset = DistributedDB::Asset; using DBStatus = DistributedDB::DBStatus; - using BindAssets = DistributedData::BindAssets; using AssetsRecord = DistributedData::AssetRecord; using AssetStatus = DistributedData::Asset::Status; using GeneralError = DistributedData::GeneralError; using VBucket = DistributedData::VBucket; - explicit RdbAssetLoader(std::shared_ptr cloudAssetLoader, BindAssets *bindAssets); + explicit RdbAssetLoader(std::shared_ptr cloudAssetLoader, BindAssets bindAssets); ~RdbAssetLoader() = default; @@ -61,7 +62,7 @@ private: std::set &skipAssets, std::set &deleteAssets); std::shared_ptr assetLoader_; - BindAssets *snapshots_; + const BindAssets snapshots_; }; } // namespace OHOS::DistributedRdb #endif // OHOS_DISTRIBUTED_DATA_DATAMGR_SERVICE_RDB_ASSET_LOADER_H \ No newline at end of file diff --git a/services/distributeddataservice/service/rdb/rdb_cloud.cpp b/services/distributeddataservice/service/rdb/rdb_cloud.cpp index 2043f3d027d2fdb9bf7d529f27dc2090566a310e..13a509127d9243cb71ae111228382a639ba402c7 100644 --- a/services/distributeddataservice/service/rdb/rdb_cloud.cpp +++ b/services/distributeddataservice/service/rdb/rdb_cloud.cpp @@ -26,8 +26,8 @@ namespace OHOS::DistributedRdb { using namespace DistributedDB; using namespace DistributedData; -RdbCloud::RdbCloud(std::shared_ptr cloudDB, BindAssets* bindAssets) - : cloudDB_(std::move(cloudDB)), snapshots_(bindAssets) +RdbCloud::RdbCloud(std::shared_ptr cloudDB, BindAssets bindAssets) + : cloudDB_(std::move(cloudDB)), snapshots_(std::move(bindAssets)) { } @@ -306,11 +306,11 @@ void RdbCloud::PostEvent(DistributedData::Value& value, DataBucket& extend, std: void RdbCloud::PostEventAsset(DistributedData::Asset& asset, DataBucket& extend, std::set& skipAssets, DistributedData::AssetEvent eventId) { - if (snapshots_->bindAssets == nullptr) { + if (snapshots_ == nullptr) { return; } - auto it = snapshots_->bindAssets->find(asset.uri); - if (it == snapshots_->bindAssets->end() || it->second == nullptr) { + auto it = snapshots_->find(asset.uri); + if (it == snapshots_->end() || it->second == nullptr) { return; } diff --git a/services/distributeddataservice/service/rdb/rdb_cloud.h b/services/distributeddataservice/service/rdb/rdb_cloud.h index 1a3f37e50aa9f8c49657065bf11939a2607d4c48..7901cd75d2186cdf7b9c08afa800228624b9cdce 100644 --- a/services/distributeddataservice/service/rdb/rdb_cloud.h +++ b/services/distributeddataservice/service/rdb/rdb_cloud.h @@ -25,6 +25,8 @@ #include "snapshot/snapshot.h" namespace OHOS::DistributedRdb { +using Snapshot = DistributedData::Snapshot; +using BindAssets = std::shared_ptr>>; class RdbCloud : public DistributedDB::ICloudDb { public: enum FLAG : uint8_t { @@ -35,10 +37,9 @@ public: using DBVBucket = DistributedDB::VBucket; using DBQueryNodes = std::vector; using DataBucket = DistributedData::VBucket; - using BindAssets = DistributedData::BindAssets; using GeneralError = DistributedData::GeneralError; - explicit RdbCloud(std::shared_ptr cloudDB, BindAssets* bindAssets); + explicit RdbCloud(std::shared_ptr cloudDB, BindAssets bindAssets); virtual ~RdbCloud() = default; DBStatus BatchInsert(const std::string &tableName, std::vector &&record, std::vector &extend) override; @@ -67,7 +68,7 @@ private: static void ConvertErrorField(DistributedData::VBuckets& extends); static constexpr int32_t TO_MS = 1000; // s > ms std::shared_ptr cloudDB_; - BindAssets* snapshots_; + const BindAssets snapshots_; uint8_t flag_ = 0; std::mutex mutex_; diff --git a/services/distributeddataservice/service/rdb/rdb_general_store.cpp b/services/distributeddataservice/service/rdb/rdb_general_store.cpp index 9a3ba03cb830b15c6eca15b8c4fdf6e17f952dff..716143e17a30fdeaefb644cbcd16e4896817e8fd 100644 --- a/services/distributeddataservice/service/rdb/rdb_general_store.cpp +++ b/services/distributeddataservice/service/rdb/rdb_general_store.cpp @@ -43,6 +43,7 @@ #include "snapshot/bind_event.h" #include "utils/anonymous.h" #include "value_proxy.h" +#include "snapshot/snapshot.h" namespace OHOS::DistributedRdb { using namespace DistributedData; using namespace DistributedDB; @@ -235,10 +236,10 @@ RdbGeneralStore::~RdbGeneralStore() executor_ = nullptr; } -int32_t RdbGeneralStore::BindSnapshots(std::shared_ptr>> bindAssets) +int32_t RdbGeneralStore::BindSnapshots(BindAssets bindAssets) { - if (snapshots_.bindAssets == nullptr) { - snapshots_.bindAssets = bindAssets; + if (snapshots_ == nullptr) { + snapshots_ = bindAssets; } return GenErr::E_OK; } @@ -270,8 +271,8 @@ int32_t RdbGeneralStore::Bind(const Database &database, const std::map lock(rdbCloudMutex_); - rdbCloud_ = std::make_shared(bindInfo_.db_, &snapshots_); - rdbLoader_ = std::make_shared(bindInfo_.loader_, &snapshots_); + rdbCloud_ = std::make_shared(bindInfo_.db_, snapshots_); + rdbLoader_ = std::make_shared(bindInfo_.loader_, snapshots_); } DistributedDB::CloudSyncConfig dbConfig; diff --git a/services/distributeddataservice/service/rdb/rdb_general_store.h b/services/distributeddataservice/service/rdb/rdb_general_store.h index 0c356bb2bc7b2c351fa38cf63dc299237b9e6b18..64296b5fbb443819e9160e088431566279d80cda 100644 --- a/services/distributeddataservice/service/rdb/rdb_general_store.h +++ b/services/distributeddataservice/service/rdb/rdb_general_store.h @@ -43,9 +43,9 @@ public: using GenErr = DistributedData::GeneralError; using RdbStore = OHOS::NativeRdb::RdbStore; using Reference = DistributedData::Reference; - using Snapshot = DistributedData::Snapshot; - using BindAssets = DistributedData::BindAssets; using DBPassword = DistributedDB::CipherPassword; + using Snapshot = DistributedData::Snapshot; + using BindAssets = std::shared_ptr>>; explicit RdbGeneralStore(const StoreMetaData &meta); ~RdbGeneralStore(); @@ -84,7 +84,7 @@ public: void SetConfig(const StoreConfig &storeConfig) override; int32_t AddRef() override; int32_t Release() override; - int32_t BindSnapshots(std::shared_ptr>> bindAssets) override; + int32_t BindSnapshots(BindAssets bindAssets) override; int32_t MergeMigratedData(const std::string &tableName, VBuckets&& values) override; int32_t CleanTrackerData(const std::string &tableName, int64_t cursor) override; std::pair LockCloudDB() override; diff --git a/services/distributeddataservice/service/test/rdb_asset_loader_test.cpp b/services/distributeddataservice/service/test/rdb_asset_loader_test.cpp index f8ef90ff1986f9f881a9ad83ce791560c2a854e0..e152010619609929773782467217851d05455b75 100644 --- a/services/distributeddataservice/service/test/rdb_asset_loader_test.cpp +++ b/services/distributeddataservice/service/test/rdb_asset_loader_test.cpp @@ -88,7 +88,7 @@ HWTEST_F(RdbAssetLoaderTest, Download, TestSize.Level0) { BindAssets bindAssets; std::shared_ptr cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, bindAssets); std::string tableName = "testTable"; std::string groupId = "testGroup"; Type prefix; @@ -109,7 +109,7 @@ HWTEST_F(RdbAssetLoaderTest, BatchDownload, TestSize.Level0) { BindAssets bindAssets; auto cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, bindAssets); std::string tableName = "testTable"; Type prefix; std::map assets; @@ -133,7 +133,7 @@ HWTEST_F(RdbAssetLoaderTest, Convert001, TestSize.Level0) { BindAssets bindAssets; auto cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, bindAssets); Type prefix; std::map assets; assets["asset1"].push_back(g_rdbAsset); @@ -156,7 +156,7 @@ HWTEST_F(RdbAssetLoaderTest, Convert002, TestSize.Level0) { BindAssets bindAssets; auto cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, bindAssets); Value prefix; VBucket assets; std::vector assetsRecords; @@ -177,7 +177,7 @@ HWTEST_F(RdbAssetLoaderTest, RemoveLocalAssets, TestSize.Level0) { BindAssets bindAssets; std::shared_ptr cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(cloudAssetLoader, bindAssets); std::vector assets; assets.push_back(g_rdbAsset); auto result = rdbAssetLoader.RemoveLocalAssets(assets); @@ -194,12 +194,12 @@ HWTEST_F(RdbAssetLoaderTest, RemoveLocalAssets, TestSize.Level0) HWTEST_F(RdbAssetLoaderTest, CancelDownloadTest, TestSize.Level0) { BindAssets bindAssets; - DistributedRdb::RdbAssetLoader rdbAssetLoader1(nullptr, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader1(nullptr, bindAssets); auto result = rdbAssetLoader1.CancelDownload(); EXPECT_EQ(result, DistributedDB::DBStatus::DB_ERROR); std::shared_ptr cloudAssetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader2(cloudAssetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader2(cloudAssetLoader, bindAssets); result = rdbAssetLoader2.CancelDownload(); EXPECT_EQ(result, DistributedDB::DBStatus::OK); } @@ -213,10 +213,9 @@ HWTEST_F(RdbAssetLoaderTest, CancelDownloadTest, TestSize.Level0) */ HWTEST_F(RdbAssetLoaderTest, PostEvent001, TestSize.Level0) { - BindAssets bindAssets; - bindAssets.bindAssets = nullptr; + BindAssets bindAssets = nullptr; std::shared_ptr assetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(assetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(assetLoader, bindAssets); std::string tableName = "testTable"; std::string groupId = "testGroup"; Type prefix; @@ -248,10 +247,9 @@ HWTEST_F(RdbAssetLoaderTest, PostEvent002, TestSize.Level0) }; DistributedData::Assets assets; assets.push_back(asset); - BindAssets bindAssets; - bindAssets.bindAssets = nullptr; + BindAssets bindAssets = nullptr; std::shared_ptr assetLoader = std::make_shared(); - DistributedRdb::RdbAssetLoader rdbAssetLoader(assetLoader, &bindAssets); + DistributedRdb::RdbAssetLoader rdbAssetLoader(assetLoader, bindAssets); std::set skipAssets; std::set deleteAssets; rdbAssetLoader.PostEvent(DistributedData::AssetEvent::DOWNLOAD, assets, skipAssets, deleteAssets); diff --git a/services/distributeddataservice/service/test/rdb_cloud_test.cpp b/services/distributeddataservice/service/test/rdb_cloud_test.cpp index 868a32ef9bfdbcf2aa4a9076d010b8142800eb18..12dbf62fe5b173476069e86b96df23b4948b03d6 100644 --- a/services/distributeddataservice/service/test/rdb_cloud_test.cpp +++ b/services/distributeddataservice/service/test/rdb_cloud_test.cpp @@ -98,7 +98,7 @@ HWTEST_F(RdbCloudTest, RdbCloudTest001, TestSize.Level1) { BindAssets bindAssets; Bytes bytes; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); + RdbCloud rdbCloud(std::make_shared(), bindAssets); std::string tableName = "testTable"; std::vector dataInsert = g_DBVBuckets; @@ -126,7 +126,7 @@ HWTEST_F(RdbCloudTest, RdbCloudTest001, TestSize.Level1) HWTEST_F(RdbCloudTest, RdbCloudTest002, TestSize.Level1) { BindAssets bindAssets; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); + RdbCloud rdbCloud(std::make_shared(), bindAssets); std::string tableName = "testTable"; rdbCloud.Lock(); std::string traceId = "id"; @@ -159,9 +159,8 @@ HWTEST_F(RdbCloudTest, RdbCloudTest002, TestSize.Level1) */ HWTEST_F(RdbCloudTest, RdbCloudTest003, TestSize.Level1) { - BindAssets bindAssets; - bindAssets.bindAssets = nullptr; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); + BindAssets bindAssets = nullptr; + RdbCloud rdbCloud(std::make_shared(), bindAssets); std::string tableName = "testTable"; DBVBucket extends = { { "#gid", { "0000000" } }, { "#flag", { true } }, { "#value", { int64_t(100) } }, { "#float", { double(100) } }, { "#_type", { int64_t(1) } } }; @@ -191,7 +190,7 @@ HWTEST_F(RdbCloudTest, RdbCloudTest003, TestSize.Level1) HWTEST_F(RdbCloudTest, RdbCloudTest004, TestSize.Level1) { BindAssets bindAssets; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); + RdbCloud rdbCloud(std::make_shared(), bindAssets); auto err = rdbCloud.UnLockCloudDB(OHOS::DistributedRdb::RdbCloud::FLAG::SYSTEM_ABILITY); EXPECT_EQ(err, GeneralError::E_NOT_SUPPORT); @@ -214,7 +213,7 @@ HWTEST_F(RdbCloudTest, RdbCloudTest004, TestSize.Level1) HWTEST_F(RdbCloudTest, ConvertStatus, TestSize.Level1) { BindAssets bindAssets; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); + RdbCloud rdbCloud(std::make_shared(), bindAssets); auto result = rdbCloud.ConvertStatus(GeneralError::E_OK); EXPECT_EQ(result, DBStatus::OK); result = rdbCloud.ConvertStatus(GeneralError::E_NETWORK_ERROR); @@ -287,7 +286,7 @@ HWTEST_F(RdbCloudTest, SetPrepareTraceId001, TestSize.Level1) EXPECT_CALL(*mockCloudDB, SetPrepareTraceId(_)).Times(0); BindAssets bindAssets; std::shared_ptr mockCloudDB = nullptr; - RdbCloud rdbCloud(mockCloudDB, &bindAssets); + RdbCloud rdbCloud(mockCloudDB, bindAssets); rdbCloud.SetPrepareTraceId(traceId); } @@ -299,8 +298,7 @@ HWTEST_F(RdbCloudTest, SetPrepareTraceId001, TestSize.Level1) HWTEST_F(RdbCloudTest, PostEvent001, TestSize.Level1) { BindAssets bindAssets; - RdbCloud rdbCloud(std::make_shared(), &bindAssets); - rdbCloud.snapshots_->bindAssets = nullptr; + RdbCloud rdbCloud(std::make_shared(), nullptr); std::string traceId = "testId"; rdbCloud.SetPrepareTraceId(traceId); std::string tableName = "testTable"; @@ -317,11 +315,10 @@ HWTEST_F(RdbCloudTest, PostEvent001, TestSize.Level1) */ HWTEST_F(RdbCloudTest, PostEvent002, TestSize.Level1) { - BindAssets snapshots; - snapshots.bindAssets = std::make_shared>>(); + BindAssets snapshots = std::make_shared>>(); std::shared_ptr snapshot; - snapshots.bindAssets->insert_or_assign(assetValue1.uri, snapshot); - RdbCloud rdbCloud(std::make_shared(), &snapshots); + snapshots->insert_or_assign(assetValue1.uri, snapshot); + RdbCloud rdbCloud(std::make_shared(), snapshots); std::string tableName = "testTable"; std::vector dataInsert = g_DBVBuckets; std::vector extendInsert = g_DBVBuckets; @@ -336,12 +333,11 @@ HWTEST_F(RdbCloudTest, PostEvent002, TestSize.Level1) */ HWTEST_F(RdbCloudTest, PostEvent003, TestSize.Level1) { - BindAssets snapshots; - snapshots.bindAssets = std::make_shared>>(); + BindAssets snapshots = std::make_shared>>(); std::shared_ptr snapshot; std::string uri = "testuri"; - snapshots.bindAssets->insert_or_assign(uri, snapshot); - RdbCloud rdbCloud(std::make_shared(), &snapshots); + snapshots->insert_or_assign(uri, snapshot); + RdbCloud rdbCloud(std::make_shared(), snapshots); std::string tableName = "testTable"; std::vector dataInsert = g_DBVBuckets; std::vector extendInsert = g_DBVBuckets; @@ -356,12 +352,11 @@ HWTEST_F(RdbCloudTest, PostEvent003, TestSize.Level1) */ HWTEST_F(RdbCloudTest, PostEvent004, TestSize.Level1) { - BindAssets snapshots; - snapshots.bindAssets = std::make_shared>>(); + BindAssets snapshots = std::make_shared>>(); std::shared_ptr snapshot = nullptr; std::string uri = "testuri"; - snapshots.bindAssets->insert_or_assign(uri, snapshot); - RdbCloud rdbCloud(std::make_shared(), &snapshots); + snapshots->insert_or_assign(uri, snapshot); + RdbCloud rdbCloud(std::make_shared(), snapshots); std::string tableName = "testTable"; std::vector dataInsert = g_DBVBuckets; std::vector extendInsert = g_DBVBuckets; @@ -380,7 +375,7 @@ HWTEST_F(RdbCloudTest, Query001, TestSize.Level1) std::string tableName = "testTable"; EXPECT_CALL(*mockCloudDB, Query(tableName, _)).WillOnce(Return(std::make_pair(E_NETWORK_ERROR, cursor))); BindAssets snapshots; - RdbCloud rdbCloud(mockCloudDB, &snapshots); + RdbCloud rdbCloud(mockCloudDB, snapshots); auto result = rdbCloud.Query(tableName, g_DBVBucket, g_DBVBuckets); EXPECT_EQ(result, DBStatus::CLOUD_NETWORK_ERROR); } @@ -401,7 +396,7 @@ HWTEST_F(RdbCloudTest, Query002, TestSize.Level1) EXPECT_CALL(*mockCursor, IsEnd()).WillOnce(Return(true)); BindAssets snapshots; - RdbCloud rdbCloud(mockCloudDB, &snapshots); + RdbCloud rdbCloud(mockCloudDB, snapshots); auto result = rdbCloud.Query(tableName, g_DBVBucket, g_DBVBuckets); EXPECT_EQ(result, DBStatus::QUERY_END); } @@ -422,7 +417,7 @@ HWTEST_F(RdbCloudTest, Query003, TestSize.Level1) EXPECT_CALL(*mockCursor, IsEnd()).WillOnce(Return(false)); BindAssets snapshots; - RdbCloud rdbCloud(mockCloudDB, &snapshots); + RdbCloud rdbCloud(mockCloudDB, snapshots); auto result = rdbCloud.Query(tableName, g_DBVBucket, g_DBVBuckets); EXPECT_EQ(result, DBStatus::CLOUD_ERROR); } diff --git a/services/distributeddataservice/service/test/rdb_general_store_test.cpp b/services/distributeddataservice/service/test/rdb_general_store_test.cpp index 24e4dfab64a3b38cc3327102ee1adce563bb553d..9cbdb2fe8a00b7b6fcdacd199a4552a0a7485d94 100644 --- a/services/distributeddataservice/service/test/rdb_general_store_test.cpp +++ b/services/distributeddataservice/service/test/rdb_general_store_test.cpp @@ -114,7 +114,7 @@ public: HWTEST_F(RdbGeneralStoreTest, BindSnapshots001, TestSize.Level1) { BindAssets bindAssets; - auto result = store->BindSnapshots(bindAssets.bindAssets); + auto result = store->BindSnapshots(bindAssets); EXPECT_EQ(result, GeneralError::E_OK); } @@ -130,9 +130,9 @@ HWTEST_F(RdbGeneralStoreTest, BindSnapshots002, TestSize.Level1) meta.isEncrypt = true; auto store = std::make_shared(meta); ASSERT_NE(store, nullptr); - store->snapshots_.bindAssets = nullptr; + store->snapshots_ = nullptr; BindAssets bindAssets; - auto result = store->BindSnapshots(bindAssets.bindAssets); + auto result = store->BindSnapshots(bindAssets); EXPECT_EQ(result, GeneralError::E_OK); }