Lines Matching refs:Field
86 using testing::Field;
1181 EXPECT_EQ("whose first field is a value which is 5 less than 10",
1183 EXPECT_EQ("whose first field is a value which is 5 more than 10",
1240 EXPECT_EQ("has a first field that is equal to \"foo\""
1241 ", and has a second field that is equal to 42",
1243 EXPECT_EQ("has a first field that isn't equal to \"foo\""
1244 ", or has a second field that isn't equal to 42",
1248 EXPECT_EQ("has a first field that isn't equal to 13"
1249 ", and has a second field that is equal to 42",
1254 // If neither field matches, Pair() should explain about the first
1255 // field.
1257 EXPECT_EQ("whose first field does not match, which is 1 less than 0",
1260 // If the first field matches but the second doesn't, Pair() should
1261 // explain about the second field.
1262 EXPECT_EQ("whose second field does not match, which is 2 less than 0",
1265 // If the first field doesn't match but the second does, Pair()
1266 // should explain about the first field.
1267 EXPECT_EQ("whose first field does not match, which is 1 less than 0",
1271 EXPECT_EQ("whose both fields match, where the first field is a value "
1272 "which is 1 more than 0, and the second field is a value "
1279 EXPECT_EQ("whose both fields match, where the first field is a value "
1286 EXPECT_EQ("whose both fields match, where the second field is a value "
1306 // Neither field matches.
1804 // Tests that Eq() matches a 2-tuple where the first field == the
1805 // second field.
1818 // Tests that Ge() matches a 2-tuple where the first field >= the
1819 // second field.
1833 // Tests that Gt() matches a 2-tuple where the first field > the
1834 // second field.
1848 // Tests that Le() matches a 2-tuple where the first field <= the
1849 // second field.
1863 // Tests that Lt() matches a 2-tuple where the first field < the
1864 // second field.
1878 // Tests that Ne() matches a 2-tuple where the first field != the
1879 // second field.
2913 // A user-defined struct for testing Field().
2919 int x; // A non-const field.
2920 const double y; // A const field.
2921 Uncopyable z; // An uncopyable field.
2922 const char* p; // A pointer field.
2928 // A derived struct for testing Field().
2936 // Tests that Field(&Foo::field, ...) works when field is non-const.
2938 Matcher<AStruct> m = Field(&AStruct::x, Ge(0));
2946 // Tests that Field(&Foo::field, ...) works when field is const.
2950 Matcher<AStruct> m = Field(&AStruct::y, Ge(0.0));
2952 m = Field(&AStruct::y, Le(0.0));
2956 // Tests that Field(&Foo::field, ...) works when field is not copyable.
2960 Matcher<AStruct> m = Field(&AStruct::z, Truly(ValueIsPositive));
2962 m = Field(&AStruct::z, Not(Truly(ValueIsPositive)));
2966 // Tests that Field(&Foo::field, ...) works when field is a pointer.
2969 Matcher<AStruct> m = Field(&AStruct::p, static_cast<const char*>(NULL));
2976 m = Field(&AStruct::p, StartsWith("hi"));
2983 // Tests that Field() works when the object is passed by reference.
2985 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
2993 // Tests that Field(&Foo::field, ...) works when the argument's type
2997 // inside Field().
2998 Matcher<const DerivedStruct&> m = Field(&AStruct::x, Ge(0));
3006 // Tests that Field(&Foo::field, m) works when field's type and m's
3009 // The field is an int, but the inner matcher expects a signed char.
3010 Matcher<const AStruct&> m = Field(&AStruct::x,
3019 // Tests that Field() can describe itself.
3021 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
3023 EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
3024 EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
3027 // Tests that Field() can explain the match result.
3029 Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
3033 EXPECT_EQ("whose given field is 1" + OfType("int"), Explain(m, a));
3035 m = Field(&AStruct::x, GreaterThan(0));
3037 "whose given field is 1" + OfType("int") + ", which is 1 more than 0",
3041 // Tests that Field() works when the argument is a pointer to const.
3043 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3051 // Tests that Field() works when the argument is a pointer to non-const.
3053 Matcher<AStruct*> m = Field(&AStruct::x, Ge(0));
3061 // Tests that Field() works when the argument is a reference to a const pointer.
3063 Matcher<AStruct* const&> m = Field(&AStruct::x, Ge(0));
3071 // Tests that Field() does not match the NULL pointer.
3073 Matcher<const AStruct*> m = Field(&AStruct::x, _);
3077 // Tests that Field(&Foo::field, ...) works when the argument's type
3081 // inside Field().
3082 Matcher<DerivedStruct*> m = Field(&AStruct::x, Ge(0));
3090 // Tests that Field() can describe itself when used to match a pointer.
3092 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3094 EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
3095 EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
3098 // Tests that Field() can explain the result of matching a pointer.
3100 Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
3105 EXPECT_EQ("which points to an object whose given field is 1" + OfType("int"),
3108 m = Field(&AStruct::x, GreaterThan(0));
3109 EXPECT_EQ("which points to an object whose given field is 1" + OfType("int") +