From f9d9bd68a08682d29a9a42ffc251c3d3f240b847 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 29 Nov 2024 15:30:48 +0800 Subject: [PATCH] add ut check. --- test/test_schema_change.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/test_schema_change.cpp b/test/test_schema_change.cpp index ef67d9933a..884b41a47a 100644 --- a/test/test_schema_change.cpp +++ b/test/test_schema_change.cpp @@ -751,8 +751,6 @@ TEST_F(TestSchemaChange, UpdateSchemaAndData) { std::unordered_map ret; for (const auto& pair : field_data) { ret.insert(pair); - std::cout << pair.first << std::endl; - std::cout << pair.second.ToString("") << std::endl; } UT_EXPECT_EQ(ret["id"], FieldData::Int32(1)); UT_EXPECT_EQ(ret["name"], FieldData::String("p")); @@ -761,4 +759,22 @@ TEST_F(TestSchemaChange, UpdateSchemaAndData) { UT_EXPECT_EQ(ret["cond"], FieldData::Int32(100)); UT_EXPECT_EQ(ret.size(), 6); } + + UT_LOG() << "Test Read data after modify"; + { + LightningGraph graph(conf); + auto txn = graph.CreateReadTxn(); + auto itr = txn.GetVertexIterator(3); + auto field_data = txn.GetVertexFields(itr); + std::unordered_map ret; + for (const auto& pair : field_data) { + ret.insert(pair); + } + UT_EXPECT_EQ(ret["id"], FieldData::Int32(4)); + UT_EXPECT_EQ(ret["name"], FieldData::String("p1")); + UT_EXPECT_EQ(ret["age"], FieldData::Float(11.5)); + UT_EXPECT_EQ(ret["desc"], FieldData::String("desc")); + UT_EXPECT_EQ(ret["cond"], FieldData::Int32(40)); + UT_EXPECT_EQ(ret.size(), 6); + } }