| Index: mojo/public/cpp/bindings/tests/equals_unittest.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/equals_unittest.cc b/mojo/public/cpp/bindings/tests/equals_unittest.cc
|
| index 1add5b0b4043f8a0301a15ef4744858a714480ba..376c2bd4ff7bdba3e26e36da890051ae2efec80f 100644
|
| --- a/mojo/public/cpp/bindings/tests/equals_unittest.cc
|
| +++ b/mojo/public/cpp/bindings/tests/equals_unittest.cc
|
| @@ -61,32 +61,34 @@ TEST_F(EqualsTest, StructNested) {
|
|
|
| TEST_F(EqualsTest, Array) {
|
| NamedRegionPtr n1(NamedRegion::New());
|
| - n1->name = "n1";
|
| - n1->rects.push_back(CreateRect());
|
| + n1->name.emplace("n1");
|
| + n1->rects.emplace();
|
| + n1->rects->push_back(CreateRect());
|
| NamedRegionPtr n2(n1.Clone());
|
| EXPECT_TRUE(n1.Equals(n2));
|
|
|
| - n2->rects = nullptr;
|
| + n2->rects = base::nullopt;
|
| EXPECT_FALSE(n1.Equals(n2));
|
| - n2->rects.resize(0);
|
| + n2->rects.emplace();
|
| EXPECT_FALSE(n1.Equals(n2));
|
|
|
| - n2->rects.push_back(CreateRect());
|
| - n2->rects.push_back(CreateRect());
|
| + n2->rects->push_back(CreateRect());
|
| + n2->rects->push_back(CreateRect());
|
| EXPECT_FALSE(n1.Equals(n2));
|
|
|
| - n2->rects.resize(1);
|
| - n2->rects[0]->width = 0;
|
| + n2->rects->resize(1);
|
| + (*n2->rects)[0]->width = 0;
|
| EXPECT_FALSE(n1.Equals(n2));
|
|
|
| - n2->rects[0] = CreateRect();
|
| + (*n2->rects)[0] = CreateRect();
|
| EXPECT_TRUE(n1.Equals(n2));
|
| }
|
|
|
| TEST_F(EqualsTest, Map) {
|
| auto n1(NamedRegion::New());
|
| - n1->name = "foo";
|
| - n1->rects.push_back(CreateRect());
|
| + n1->name.emplace("foo");
|
| + n1->rects.emplace();
|
| + n1->rects->push_back(CreateRect());
|
|
|
| Map<std::string, NamedRegionPtr> m1;
|
| m1.insert("foo", std::move(n1));
|
| @@ -98,15 +100,15 @@ TEST_F(EqualsTest, Map) {
|
| EXPECT_FALSE(m1.Equals(m2));
|
|
|
| m2 = m1.Clone();
|
| - m2.at("foo")->name = "monkey";
|
| + m2.at("foo")->name.emplace("monkey");
|
| EXPECT_FALSE(m1.Equals(m2));
|
|
|
| m2 = m1.Clone();
|
| - m2.at("foo")->rects.push_back(Rect::New());
|
| + m2.at("foo")->rects->push_back(Rect::New());
|
| EXPECT_FALSE(m1.Equals(m2));
|
|
|
| - m2.at("foo")->rects.resize(1);
|
| - m2.at("foo")->rects[0]->width = 1;
|
| + m2.at("foo")->rects->resize(1);
|
| + (*m2.at("foo")->rects)[0]->width = 1;
|
| EXPECT_FALSE(m1.Equals(m2));
|
|
|
| m2 = m1.Clone();
|
|
|