Commit 933c4a6c authored by miloyip's avatar miloyip

Improve Value deep-clone coverage

parent 4bcedab5
...@@ -245,6 +245,13 @@ void TestCopyFrom() { ...@@ -245,6 +245,13 @@ void TestCopyFrom() {
EXPECT_STREQ(v1.GetString(), v2.GetString()); EXPECT_STREQ(v1.GetString(), v2.GetString());
EXPECT_EQ(v1.GetString(), v2.GetString()); // string NOT copied EXPECT_EQ(v1.GetString(), v2.GetString()); // string NOT copied
v1.SetString("bar", a); // copy string
v2.CopyFrom(v1, a);
EXPECT_TRUE(v1.GetType() == v2.GetType());
EXPECT_STREQ(v1.GetString(), v2.GetString());
EXPECT_NE(v1.GetString(), v2.GetString()); // string copied
v1.SetArray().PushBack(1234, a); v1.SetArray().PushBack(1234, a);
v2.CopyFrom(v1, a); v2.CopyFrom(v1, a);
EXPECT_TRUE(v2.IsArray()); EXPECT_TRUE(v2.IsArray());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment