Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: mojo/public/cpp/bindings/tests/equals_unittest.cc

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
deleted file mode 100644
index 3468a2c92afbe9007cafc42325de87fd0b4e55e8..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/tests/equals_unittest.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gtest/gtest.h"
-#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
-
-namespace mojo {
-namespace test {
-
-namespace {
-
-RectPtr CreateRect() {
- RectPtr r = Rect::New();
- r->x = 1;
- r->y = 2;
- r->width = 3;
- r->height = 4;
- return r;
-}
-
-} // namespace
-
-TEST(EqualsTest, Null) {
- RectPtr r1;
- RectPtr r2;
- EXPECT_TRUE(r1.Equals(r2));
- EXPECT_TRUE(r2.Equals(r1));
-
- r1 = CreateRect();
- EXPECT_FALSE(r1.Equals(r2));
- EXPECT_FALSE(r2.Equals(r1));
-}
-
-TEST(EqualsTest, EqualsStruct) {
- RectPtr r1(CreateRect());
- RectPtr r2(r1.Clone());
- EXPECT_TRUE(r1.Equals(r2));
- r2->y = 1;
- EXPECT_FALSE(r1.Equals(r2));
- r2.reset();
- EXPECT_FALSE(r1.Equals(r2));
-}
-
-TEST(EqualsTest, EqualsStructNested) {
- RectPairPtr p1(RectPair::New());
- p1->first = CreateRect();
- p1->second = CreateRect();
- RectPairPtr p2(p1.Clone());
- EXPECT_TRUE(p1.Equals(p2));
- p2->second->width = 0;
- EXPECT_FALSE(p1.Equals(p2));
- p2->second.reset();
- EXPECT_FALSE(p1.Equals(p2));
-}
-
-TEST(EqualsTest, EqualsArray) {
- NamedRegionPtr n1(NamedRegion::New());
- n1->name = "n1";
- n1->rects.push_back(CreateRect());
- NamedRegionPtr n2(n1.Clone());
- EXPECT_TRUE(n1.Equals(n2));
-
- n2->rects.reset();
- EXPECT_FALSE(n1.Equals(n2));
- n2->rects.resize(0);
- EXPECT_FALSE(n1.Equals(n2));
-
- n2->rects.push_back(CreateRect());
- n2->rects.push_back(CreateRect());
- EXPECT_FALSE(n1.Equals(n2));
-
- n2->rects.resize(1);
- n2->rects[0]->width = 0;
- EXPECT_FALSE(n1.Equals(n2));
-
- n2->rects[0] = CreateRect();
- EXPECT_TRUE(n1.Equals(n2));
-}
-
-TEST(EqualsTest, EqualsMap) {
- auto n1(NamedRegion::New());
- n1->name = "foo";
- n1->rects.push_back(CreateRect());
-
- Map<std::string, NamedRegionPtr> m1;
- m1.insert("foo", n1.Pass());
-
- decltype(m1) m2;
- EXPECT_FALSE(m1.Equals(m2));
-
- m2.insert("bar", m1.at("foo").Clone());
- EXPECT_FALSE(m1.Equals(m2));
-
- m2 = m1.Clone();
- m2.at("foo")->name = "monkey";
- EXPECT_FALSE(m1.Equals(m2));
-
- m2 = m1.Clone();
- 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;
- EXPECT_FALSE(m1.Equals(m2));
-
- m2 = m1.Clone();
- EXPECT_TRUE(m1.Equals(m2));
-}
-
-} // test
-} // mojo
« no previous file with comments | « mojo/public/cpp/bindings/tests/container_test_util.cc ('k') | mojo/public/cpp/bindings/tests/formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698