Lines Matching defs:Test
21 // Object used to test complex object with Optional<T> in addition of the move
186 TEST(OptionalTest, DefaultConstructor) {
203 TEST(OptionalTest, CopyConstructor) {
241 TEST(OptionalTest, ValueConstructor) {
268 TEST(OptionalTest, MoveConstructor) {
336 TEST(OptionalTest, MoveValueConstructor) {
371 TEST(OptionalTest, ConvertingCopyConstructor) {
386 TEST(OptionalTest, ConvertingMoveConstructor) {
430 TEST(OptionalTest, ConstructorForwardArguments) {
456 TEST(OptionalTest, ConstructorForwardInitListAndArguments) {
472 TEST(OptionalTest, ForwardConstructor) {
479 // Test that default type of 'U' is value_type.
506 struct Test {
507 Test() : param_type(ParamType::DEFAULT_CONSTRUCTED) {}
508 Test(const Test& param) : param_type(ParamType::COPY_CONSTRUCTED) {}
509 Test(Test&& param) : param_type(ParamType::MOVE_CONSTRUCTED) {}
510 explicit Test(int param) : param_type(ParamType::INT) {}
511 explicit Test(in_place_t param) : param_type(ParamType::IN_PLACE) {}
512 explicit Test(Optional<int> param)
521 Optional<Test> testee(arg);
527 Optional<Test> testee(Optional<int>(in_place, 1));
533 Optional<Test> testee(in_place);
539 struct Test {
540 Test(int a) {} // NOLINT(runtime/explicit)
543 static_assert(std::is_convertible<int, Test>::value,
544 "Int should be convertible to Test.");
545 ([](Optional<Test> param) {})(1);
549 TEST(OptionalTest, NulloptConstructor) {
554 TEST(OptionalTest, AssignValue) {
596 TEST(OptionalTest, AssignObject) {
689 TEST(OptionalTest, AssignObject_rvalue) {
787 TEST(OptionalTest, AssignNull) {
813 TEST(OptionalTest, AssignOverload) {
997 TEST(OptionalTest, OperatorStar) {
1014 TEST(OptionalTest, OperatorStar_rvalue) {
1020 TEST(OptionalTest, OperatorArrow) {
1025 TEST(OptionalTest, Value_rvalue) {
1032 TEST(OptionalTest, ValueOr) {
1079 TEST(OptionalTest, Swap_bothNoValue) {
1089 TEST(OptionalTest, Swap_inHasValue) {
1101 TEST(OptionalTest, Swap_outHasValue) {
1112 TEST(OptionalTest, Swap_bothValue) {
1125 TEST(OptionalTest, Emplace) {
1169 TEST(OptionalTest, Equals_TwoEmpty) {
1176 TEST(OptionalTest, Equals_TwoEquals) {
1183 TEST(OptionalTest, Equals_OneEmpty) {
1190 TEST(OptionalTest, Equals_TwoDifferent) {
1197 TEST(OptionalTest, Equals_DifferentType) {
1204 TEST(OptionalTest, NotEquals_TwoEmpty) {
1211 TEST(OptionalTest, NotEquals_TwoEquals) {
1218 TEST(OptionalTest, NotEquals_OneEmpty) {
1225 TEST(OptionalTest, NotEquals_TwoDifferent) {
1232 TEST(OptionalTest, NotEquals_DifferentType) {
1239 TEST(OptionalTest, Less_LeftEmpty) {
1246 TEST(OptionalTest, Less_RightEmpty) {
1253 TEST(OptionalTest, Less_BothEmpty) {
1260 TEST(OptionalTest, Less_BothValues) {
1281 TEST(OptionalTest, Less_DifferentType) {
1288 TEST(OptionalTest, LessEq_LeftEmpty) {
1295 TEST(OptionalTest, LessEq_RightEmpty) {
1302 TEST(OptionalTest, LessEq_BothEmpty) {
1309 TEST(OptionalTest, LessEq_BothValues) {
1330 TEST(OptionalTest, LessEq_DifferentType) {
1337 TEST(OptionalTest, Greater_BothEmpty) {
1344 TEST(OptionalTest, Greater_LeftEmpty) {
1351 TEST(OptionalTest, Greater_RightEmpty) {
1358 TEST(OptionalTest, Greater_BothValue) {
1379 TEST(OptionalTest, Greater_DifferentType) {
1386 TEST(OptionalTest, GreaterEq_BothEmpty) {
1393 TEST(OptionalTest, GreaterEq_LeftEmpty) {
1400 TEST(OptionalTest, GreaterEq_RightEmpty) {
1407 TEST(OptionalTest, GreaterEq_BothValue) {
1428 TEST(OptionalTest, GreaterEq_DifferentType) {
1435 TEST(OptionalTest, OptNullEq) {
1446 TEST(OptionalTest, NullOptEq) {
1457 TEST(OptionalTest, OptNullNotEq) {
1468 TEST(OptionalTest, NullOptNotEq) {
1479 TEST(OptionalTest, OptNullLower) {
1490 TEST(OptionalTest, NullOptLower) {
1501 TEST(OptionalTest, OptNullLowerEq) {
1512 TEST(OptionalTest, NullOptLowerEq) {
1523 TEST(OptionalTest, OptNullGreater) {
1534 TEST(OptionalTest, NullOptGreater) {
1545 TEST(OptionalTest, OptNullGreaterEq) {
1556 TEST(OptionalTest, NullOptGreaterEq) {
1567 TEST(OptionalTest, ValueEq_Empty) {
1572 TEST(OptionalTest, ValueEq_NotEmpty) {
1583 TEST(OptionalTest, ValueEq_DifferentType) {
1588 TEST(OptionalTest, EqValue_Empty) {
1593 TEST(OptionalTest, EqValue_NotEmpty) {
1604 TEST(OptionalTest, EqValue_DifferentType) {
1609 TEST(OptionalTest, ValueNotEq_Empty) {
1614 TEST(OptionalTest, ValueNotEq_NotEmpty) {
1625 TEST(OPtionalTest, ValueNotEq_DifferentType) {
1630 TEST(OptionalTest, NotEqValue_Empty) {
1635 TEST(OptionalTest, NotEqValue_NotEmpty) {
1646 TEST(OptionalTest, NotEqValue_DifferentType) {
1651 TEST(OptionalTest, ValueLess_Empty) {
1656 TEST(OptionalTest, ValueLess_NotEmpty) {
1671 TEST(OPtionalTest, ValueLess_DifferentType) {
1676 TEST(OptionalTest, LessValue_Empty) {
1681 TEST(OptionalTest, LessValue_NotEmpty) {
1696 TEST(OptionalTest, LessValue_DifferentType) {
1701 TEST(OptionalTest, ValueLessEq_Empty) {
1706 TEST(OptionalTest, ValueLessEq_NotEmpty) {
1721 TEST(OptionalTest, ValueLessEq_DifferentType) {
1726 TEST(OptionalTest, LessEqValue_Empty) {
1731 TEST(OptionalTest, LessEqValue_NotEmpty) {
1746 TEST(OptionalTest, LessEqValue_DifferentType) {
1751 TEST(OptionalTest, ValueGreater_Empty) {
1756 TEST(OptionalTest, ValueGreater_NotEmpty) {
1771 TEST(OptionalTest, ValueGreater_DifferentType) {
1776 TEST(OptionalTest, GreaterValue_Empty) {
1781 TEST(OptionalTest, GreaterValue_NotEmpty) {
1796 TEST(OptionalTest, GreaterValue_DifferentType) {
1801 TEST(OptionalTest, ValueGreaterEq_Empty) {
1806 TEST(OptionalTest, ValueGreaterEq_NotEmpty) {
1821 TEST(OptionalTest, ValueGreaterEq_DifferentType) {
1826 TEST(OptionalTest, GreaterEqValue_Empty) {
1831 TEST(OptionalTest, GreaterEqValue_NotEmpty) {
1846 TEST(OptionalTest, GreaterEqValue_DifferentType) {
1851 TEST(OptionalTest, NotEquals) {
1877 TEST(OptionalTest, NotEqualsNull) {
1900 TEST(OptionalTest, MakeOptional) {
1945 struct Test {
1946 Test(int a, double b, bool c) : a(a), b(b), c(c) {}
1953 Optional<Test> o = base::make_optional<Test>(1, 2.0, true);
1970 TEST(OptionalTest, NonMemberSwap_bothNoValue) {
1980 TEST(OptionalTest, NonMemberSwap_inHasValue) {
1991 TEST(OptionalTest, NonMemberSwap_outHasValue) {
2002 TEST(OptionalTest, NonMemberSwap_bothValue) {
2015 TEST(OptionalTest, Hash_OptionalReflectsInternal) {
2032 TEST(OptionalTest, Hash_NullOptEqualsNullOpt) {
2040 TEST(OptionalTest, Hash_UseInSet) {
2050 TEST(OptionalTest, HasValue) {
2067 TEST(OptionalTest, Reset_int) {
2077 TEST(OptionalTest, Reset_Object) {
2087 TEST(OptionalTest, Reset_NoOp) {
2095 TEST(OptionalTest, AssignFromRValue) {
2105 TEST(OptionalTest, DontCallDefaultCtor) {
2114 TEST(OptionalTest, DontCallNewMemberFunction) {
2122 TEST(OptionalTest, Noexcept) {