Lines Matching refs:TestObject
23 class TestObject { class
36 TestObject() : foo_(0), bar_(0.0), state_(State::DEFAULT_CONSTRUCTED) {} in TestObject() function in base::__anon9078113f0111::TestObject
38 TestObject(int foo, double bar) in TestObject() function in base::__anon9078113f0111::TestObject
41 TestObject(const TestObject& other) in TestObject() function in base::__anon9078113f0111::TestObject
47 TestObject(TestObject&& other) in TestObject() function in base::__anon9078113f0111::TestObject
55 TestObject& operator=(const TestObject& other) { in operator =()
63 TestObject& operator=(TestObject&& other) { in operator =()
72 void Swap(TestObject* other) { in Swap()
81 bool operator==(const TestObject& other) const { in operator ==()
85 bool operator!=(const TestObject& other) const { return !(*this == other); } in operator !=()
99 void swap(TestObject& lhs, TestObject& rhs) { in swap()
198 Optional<TestObject> o; in TEST()
232 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
233 Optional<TestObject> other(first); in TEST()
236 EXPECT_TRUE(other.value() == TestObject(3, 0.1)); in TEST()
259 TestObject value(3, 0.1); in TEST()
260 Optional<TestObject> o(value); in TEST()
263 EXPECT_EQ(TestObject::State::COPY_CONSTRUCTED, o->state()); in TEST()
290 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
291 Optional<TestObject> second(std::move(first)); in TEST()
294 EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, second->state()); in TEST()
295 EXPECT_TRUE(TestObject(3, 0.1) == second.value()); in TEST()
298 EXPECT_EQ(TestObject::State::MOVED_FROM, first->state()); in TEST()
362 TestObject value(3, 0.1); in TEST()
363 Optional<TestObject> o(std::move(value)); in TEST()
366 EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, o->state()); in TEST()
367 EXPECT_EQ(TestObject(3, 0.1), o.value()); in TEST()
450 Optional<TestObject> a(base::in_place, 0, 0.1); in TEST()
452 EXPECT_TRUE(TestObject(0, 0.1) == a.value()); in TEST()
576 Optional<TestObject> a; in TEST()
578 a = TestObject(3, 0.1); in TEST()
581 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
586 Optional<TestObject> a = TestObject(4, 1.0); in TEST()
588 a = TestObject(3, 0.1); in TEST()
591 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
618 Optional<TestObject> a; in TEST()
619 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
623 EXPECT_TRUE(a.value() == TestObject(3, 0.1)); in TEST()
628 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
629 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
633 EXPECT_TRUE(a.value() == TestObject(3, 0.1)); in TEST()
711 Optional<TestObject> a; in TEST()
712 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
717 EXPECT_TRUE(TestObject(3, 0.1) == a.value()); in TEST()
719 EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, a->state()); in TEST()
720 EXPECT_EQ(TestObject::State::MOVED_FROM, b->state()); in TEST()
724 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
725 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
730 EXPECT_TRUE(TestObject(3, 0.1) == a.value()); in TEST()
732 EXPECT_EQ(TestObject::State::MOVE_ASSIGNED, a->state()); in TEST()
733 EXPECT_EQ(TestObject::State::MOVED_FROM, b->state()); in TEST()
805 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
806 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
1009 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1017 EXPECT_TRUE(TestObject(3, 0.1) == *Optional<TestObject>(TestObject(3, 0.1))); in TEST()
1021 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1028 EXPECT_TRUE(TestObject(3, 0.1) == in TEST()
1029 Optional<TestObject>(TestObject(3, 0.1)).value()); in TEST()
1068 Optional<TestObject> a; in TEST()
1069 EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(1, 0.3)); in TEST()
1071 a = TestObject(3, 0.1); in TEST()
1072 EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(3, 0.1)); in TEST()
1075 EXPECT_TRUE(a.value_or(TestObject(1, 0.3)) == TestObject(1, 0.3)); in TEST()
1080 Optional<TestObject> a, b; in TEST()
1085 EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); in TEST()
1086 EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); in TEST()
1090 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1091 Optional<TestObject> b; in TEST()
1097 EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); in TEST()
1098 EXPECT_TRUE(TestObject(1, 0.3) == b.value_or(TestObject(42, 0.42))); in TEST()
1102 Optional<TestObject> a; in TEST()
1103 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1108 EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); in TEST()
1109 EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); in TEST()
1113 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1114 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1119 EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); in TEST()
1120 EXPECT_TRUE(TestObject(0, 0.1) == b.value_or(TestObject(42, 0.42))); in TEST()
1121 EXPECT_EQ(TestObject::State::SWAPPED, a->state()); in TEST()
1122 EXPECT_EQ(TestObject::State::SWAPPED, b->state()); in TEST()
1143 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1144 EXPECT_EQ(TestObject(1, 0.2), a.emplace(TestObject(1, 0.2))); in TEST()
1147 EXPECT_TRUE(TestObject(1, 0.2) == a.value()); in TEST()
1871 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1872 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
1893 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1894 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
1929 Optional<TestObject> o = base::make_optional(TestObject(3, 0.1)); in TEST()
1931 EXPECT_TRUE(TestObject(3, 0.1) == *o); in TEST()
1933 TestObject value = TestObject(0, 0.42); in TEST()
1936 EXPECT_TRUE(TestObject(0, 0.42) == *o); in TEST()
1937 EXPECT_EQ(TestObject::State::MOVED_FROM, value.state()); in TEST()
1938 EXPECT_EQ(TestObject::State::MOVE_ASSIGNED, o->state()); in TEST()
1940 EXPECT_EQ(TestObject::State::MOVE_CONSTRUCTED, in TEST()
1971 Optional<TestObject> a, b; in TEST()
1976 EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); in TEST()
1977 EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); in TEST()
1981 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1982 Optional<TestObject> b; in TEST()
1987 EXPECT_TRUE(TestObject(42, 0.42) == a.value_or(TestObject(42, 0.42))); in TEST()
1988 EXPECT_TRUE(TestObject(1, 0.3) == b.value_or(TestObject(42, 0.42))); in TEST()
1992 Optional<TestObject> a; in TEST()
1993 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1998 EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); in TEST()
1999 EXPECT_TRUE(TestObject(42, 0.42) == b.value_or(TestObject(42, 0.42))); in TEST()
2003 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2004 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
2009 EXPECT_TRUE(TestObject(1, 0.3) == a.value_or(TestObject(42, 0.42))); in TEST()
2010 EXPECT_TRUE(TestObject(0, 0.1) == b.value_or(TestObject(42, 0.42))); in TEST()
2011 EXPECT_EQ(TestObject::State::SWAPPED, a->state()); in TEST()
2012 EXPECT_EQ(TestObject::State::SWAPPED, b->state()); in TEST()
2078 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2080 EXPECT_EQ(TestObject(0, 0.1), a.value()); in TEST()
2084 EXPECT_EQ(TestObject(42, 0.0), a.value_or(TestObject(42, 0.0))); in TEST()
2096 Optional<TestObject> a; in TEST()
2099 TestObject obj; in TEST()