From 1c6f22ddb0e5ea6b777ddb4fdb741b1b67fcad4f Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Wed, 10 Sep 2025 10:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E8=A2=AB=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang --- .../framework/cloud/schema_meta.cpp | 15 ----- .../framework/include/cloud/schema_meta.h | 3 - .../framework/test/cloud_test.cpp | 59 ------------------- 3 files changed, 77 deletions(-) diff --git a/services/distributeddataservice/framework/cloud/schema_meta.cpp b/services/distributeddataservice/framework/cloud/schema_meta.cpp index a34b86873..5bc356c90 100644 --- a/services/distributeddataservice/framework/cloud/schema_meta.cpp +++ b/services/distributeddataservice/framework/cloud/schema_meta.cpp @@ -117,11 +117,6 @@ bool Database::operator==(const Database &database) const database.deviceId, database.autoSyncType); } -bool Database::operator!=(const Database &database) const -{ - return !operator==(database); -} - bool Table::Marshal(Serializable::json &node) const { SetValue(node[GET_NAME(name)], name); @@ -152,11 +147,6 @@ bool Table::operator==(const Table &table) const table.sharedTableName); } -bool Table::operator!=(const Table &table) const -{ - return !operator==(table); -} - bool Field::Marshal(Serializable::json &node) const { SetValue(node[GET_NAME(colName)], colName); @@ -185,11 +175,6 @@ bool Field::operator==(const Field &field) const std::tie(field.colName, field.alias, field.type, field.primary, field.nullable); } -bool Field::operator!=(const Field &field) const -{ - return !operator==(field); -} - Database SchemaMeta::GetDataBase(const std::string &storeId) { for (const auto &database : databases) { diff --git a/services/distributeddataservice/framework/include/cloud/schema_meta.h b/services/distributeddataservice/framework/include/cloud/schema_meta.h index 4d8c6ad83..fd1e3df04 100644 --- a/services/distributeddataservice/framework/include/cloud/schema_meta.h +++ b/services/distributeddataservice/framework/include/cloud/schema_meta.h @@ -26,7 +26,6 @@ struct API_EXPORT Field final : public Serializable { bool Marshal(json &node) const override; bool Unmarshal(const json &node) override; bool operator==(const Field &field) const; - bool operator!=(const Field &field) const; }; struct API_EXPORT Table final : public Serializable { @@ -39,7 +38,6 @@ struct API_EXPORT Table final : public Serializable { bool Marshal(json &node) const override; bool Unmarshal(const json &node) override; bool operator==(const Table &table) const; - bool operator!=(const Table &table) const; }; struct API_EXPORT Database final : public Serializable { @@ -58,7 +56,6 @@ struct API_EXPORT Database final : public Serializable { bool Marshal(json &node) const override; bool Unmarshal(const json &node) override; bool operator==(const Database &database) const; - bool operator!=(const Database &database) const; }; class API_EXPORT SchemaMeta final : public Serializable { diff --git a/services/distributeddataservice/framework/test/cloud_test.cpp b/services/distributeddataservice/framework/test/cloud_test.cpp index e39d12fe6..27f82ceb2 100644 --- a/services/distributeddataservice/framework/test/cloud_test.cpp +++ b/services/distributeddataservice/framework/test/cloud_test.cpp @@ -451,54 +451,6 @@ HWTEST_F(CloudInfoTest, TableTest002, TestSize.Level0) Table table2 = table1; EXPECT_EQ(table2, table1); - - table2.sharedTableName = "share"; - EXPECT_NE(table2, table1); - table2.cloudSyncFields.push_back("cloud"); - EXPECT_NE(table2, table1); - table2.deviceSyncFields.push_back("device"); - EXPECT_NE(table2, table1); - table2.fields[0].primary = true; - EXPECT_NE(table2, table1); - table2.alias = "test2_alias"; - EXPECT_NE(table2, table1); - table2.name = "test2_name"; - EXPECT_NE(table2, table1); -} - -/** -* @tc.name: TableTest003 -* @tc.desc: Table Overload function Field test. -* @tc.type: FUNC -* @tc.require: -* @tc.author: -*/ -HWTEST_F(CloudInfoTest, TableTest003, TestSize.Level0) -{ - Field field1; - field1.colName = "test1_colName"; - field1.alias = "test1_alias"; - field1.type = 1; - field1.primary = true; - field1.nullable = false; - - Table table1; - table1.name = "test1_name"; - table1.sharedTableName = "test1_sharedTableName"; - table1.alias = "test1_alias"; - table1.fields.push_back(field1); - - Table table2 = table1; - table2.fields[0].nullable = true; - EXPECT_NE(table2, table1); - table2.fields[0].primary = false; - EXPECT_NE(table2, table1); - table2.fields[0].type = 2; - EXPECT_NE(table2, table1); - table2.fields[0].alias = "test2_alias"; - EXPECT_NE(table2, table1); - table2.fields[0].colName = "test1_colName"; - EXPECT_NE(table2, table1); } /** @@ -520,17 +472,6 @@ HWTEST_F(CloudInfoTest, FieldTest, TestSize.Level0) Field field2 = field1; EXPECT_EQ(field2, field1); - - field2.nullable = true; - EXPECT_NE(field2, field1); - field2.primary = false; - EXPECT_NE(field2, field1); - field2.type = 2; - EXPECT_NE(field2, field1); - field2.alias = "test2_alias"; - EXPECT_NE(field2, field1); - field2.colName = "test2_colName"; - EXPECT_NE(field2, field1); } /** -- Gitee