Skip to content

Commit

Permalink
add ut check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinLeeo committed Dec 2, 2024
1 parent 72dc0f3 commit 9b3dedf
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/test_schema_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,6 @@ TEST_F(TestSchemaChange, UpdateSchemaAndData) {
std::unordered_map<std::string, FieldData> 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"));
Expand All @@ -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<std::string, FieldData> 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);
}
}

0 comments on commit 9b3dedf

Please sign in to comment.