44 #include "gmock/gmock.h" 45 #include "gtest/gtest.h" 46 #include "gtest/gtest-spi.h" 54 using std::stringstream;
85 #define GMOCK_ARRAY_SIZE_(a) (sizeof(a) / sizeof(a[0])) 89 string Describe(
const Matcher<T>& m) {
99 m.DescribeNegationTo(&ss);
104 template <
typename MatcherType,
typename Value>
107 m.ExplainMatchResultTo(x, &ss);
113 TEST(ArgsTest, AcceptsZeroTemplateArg) {
114 const tuple<int, bool> t(5,
true);
119 TEST(ArgsTest, AcceptsOneTemplateArg) {
120 const tuple<int, bool> t(5,
true);
126 TEST(ArgsTest, AcceptsTwoTemplateArgs) {
127 const tuple<short, int, long> t(4, 5, 6L);
134 TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
135 const tuple<short, int, long> t(4, 5, 6L);
140 TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
141 const tuple<short, int, long> t(4, 5, 6L);
152 # pragma warning(push) 153 # pragma warning(disable:4100) 157 return get<0>(
arg) + get<1>(
arg) + get<2>(
arg) == 0;
160 TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
165 TEST(ArgsTest, CanBeNested) {
166 const tuple<short, int, long, int> t(4, 5, 6L, 6);
171 TEST(ArgsTest, CanMatchTupleByValue) {
172 typedef tuple<char, int, int> Tuple3;
173 const Matcher<Tuple3> m = Args<1, 2>(
Lt());
178 TEST(ArgsTest, CanMatchTupleByReference) {
179 typedef tuple<char, char, int> Tuple3;
180 const Matcher<const Tuple3&> m = Args<0, 1>(
Lt());
190 TEST(ArgsTest, AcceptsTenTemplateArgs) {
191 EXPECT_THAT(
make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
192 (Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
193 PrintsAs(
"(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
194 EXPECT_THAT(
make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
195 Not(Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
196 PrintsAs(
"(0, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
199 TEST(ArgsTest, DescirbesSelfCorrectly) {
200 const Matcher<tuple<int, bool, char> > m = Args<2, 0>(
Lt());
201 EXPECT_EQ(
"are a tuple whose fields (#2, #0) are a pair where " 202 "the first < the second",
206 TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
207 const Matcher<const tuple<int, bool, char, int>&> m =
208 Args<0, 2, 3>(Args<2, 0>(
Lt()));
209 EXPECT_EQ(
"are a tuple whose fields (#0, #2, #3) are a tuple " 210 "whose fields (#2, #0) are a pair where the first < the second",
214 TEST(ArgsTest, DescribesNegationCorrectly) {
215 const Matcher<tuple<int, char> > m = Args<1, 0>(
Gt());
216 EXPECT_EQ(
"are a tuple whose fields (#1, #0) aren't a pair " 217 "where the first > the second",
221 TEST(ArgsTest, ExplainsMatchResultWithoutInnerExplanation) {
222 const Matcher<tuple<bool, int, int> > m = Args<1, 2>(
Eq());
223 EXPECT_EQ(
"whose fields (#1, #2) are (42, 42)",
225 EXPECT_EQ(
"whose fields (#1, #2) are (42, 43)",
230 class LessThanMatcher :
public MatcherInterface<tuple<char, int> > {
232 virtual void DescribeTo(::std::ostream* os)
const {}
234 virtual bool MatchAndExplain(tuple<char, int> value,
235 MatchResultListener* listener)
const {
236 const int diff = get<0>(value) - get<1>(value);
238 *listener <<
"where the first value is " << diff
239 <<
" more than the second";
245 Matcher<tuple<char, int> > LessThan() {
249 TEST(ArgsTest, ExplainsMatchResultWithInnerExplanation) {
250 const Matcher<tuple<char, int, int> > m = Args<0, 2>(LessThan());
251 EXPECT_EQ(
"whose fields (#0, #2) are ('a' (97, 0x61), 42), " 252 "where the first value is 55 more than the second",
254 EXPECT_EQ(
"whose fields (#0, #2) are ('\\0', 43)",
259 class GreaterThanMatcher :
public MatcherInterface<int> {
261 explicit GreaterThanMatcher(
int rhs) : rhs_(rhs) {}
263 virtual void DescribeTo(::std::ostream* os)
const {
264 *os <<
"is greater than " << rhs_;
267 virtual bool MatchAndExplain(
int lhs,
268 MatchResultListener* listener)
const {
269 const int diff = lhs - rhs_;
271 *listener <<
"which is " << diff <<
" more than " << rhs_;
272 }
else if (diff == 0) {
273 *listener <<
"which is the same as " << rhs_;
275 *listener <<
"which is " << -diff <<
" less than " << rhs_;
291 TEST(ElementsAreTest, CanDescribeExpectingNoElement) {
296 TEST(ElementsAreTest, CanDescribeExpectingOneElement) {
301 TEST(ElementsAreTest, CanDescribeExpectingManyElements) {
304 "element #0 is equal to \"one\",\n" 305 "element #1 is equal to \"two\"",
Describe(m));
308 TEST(ElementsAreTest, CanDescribeNegationOfExpectingNoElement) {
313 TEST(ElementsAreTest, CanDescribeNegationOfExpectingOneElment) {
319 TEST(ElementsAreTest, CanDescribeNegationOfExpectingManyElements) {
320 Matcher<const list<string>& > m =
ElementsAre(
"one",
"two");
321 EXPECT_EQ(
"doesn't have 2 elements, or\n" 322 "element #0 isn't equal to \"one\", or\n" 326 TEST(ElementsAreTest, DoesNotExplainTrivialMatch) {
330 test_list.push_back(1);
331 test_list.push_back(3);
335 TEST(ElementsAreTest, ExplainsNonTrivialMatch) {
336 Matcher<const vector<int>& > m =
339 const int a[] = { 10, 0, 100 };
341 EXPECT_EQ(
"whose element #0 matches, which is 9 more than 1,\n" 342 "and whose element #2 matches, which is 98 more than 2",
346 TEST(ElementsAreTest, CanExplainMismatchWrongSize) {
353 test_list.push_back(1);
357 TEST(ElementsAreTest, CanExplainMismatchRightSize) {
366 EXPECT_EQ(
"whose element #1 doesn't match, which is 4 less than 5",
370 TEST(ElementsAreTest, MatchesOneElementVector) {
371 vector<string> test_vector;
372 test_vector.push_back(
"test string");
377 TEST(ElementsAreTest, MatchesOneElementList) {
379 test_list.push_back(
"test string");
384 TEST(ElementsAreTest, MatchesThreeElementVector) {
385 vector<string> test_vector;
386 test_vector.push_back(
"one");
387 test_vector.push_back(
"two");
388 test_vector.push_back(
"three");
393 TEST(ElementsAreTest, MatchesOneElementEqMatcher) {
394 vector<int> test_vector;
395 test_vector.push_back(4);
400 TEST(ElementsAreTest, MatchesOneElementAnyMatcher) {
401 vector<int> test_vector;
402 test_vector.push_back(4);
407 TEST(ElementsAreTest, MatchesOneElementValue) {
408 vector<int> test_vector;
409 test_vector.push_back(4);
414 TEST(ElementsAreTest, MatchesThreeElementsMixedMatchers) {
415 vector<int> test_vector;
416 test_vector.push_back(1);
417 test_vector.push_back(2);
418 test_vector.push_back(3);
423 TEST(ElementsAreTest, MatchesTenElementVector) {
424 const int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
433 TEST(ElementsAreTest, DoesNotMatchWrongSize) {
434 vector<string> test_vector;
435 test_vector.push_back(
"test string");
436 test_vector.push_back(
"test string");
442 TEST(ElementsAreTest, DoesNotMatchWrongValue) {
443 vector<string> test_vector;
444 test_vector.push_back(
"other string");
450 TEST(ElementsAreTest, DoesNotMatchWrongOrder) {
451 vector<string> test_vector;
452 test_vector.push_back(
"one");
453 test_vector.push_back(
"three");
454 test_vector.push_back(
"two");
461 TEST(ElementsAreTest, WorksForNestedContainer) {
462 const char* strings[] = {
467 vector<list<char> > nested;
469 nested.push_back(list<char>(strings[i], strings[i] + strlen(strings[i])));
478 TEST(ElementsAreTest, WorksWithByRefElementMatchers) {
479 int a[] = { 0, 1, 2 };
486 TEST(ElementsAreTest, WorksWithContainerPointerUsingPointee) {
487 int a[] = { 0, 1, 2 };
494 TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) {
495 int array[] = { 0, 1, 2 };
501 class NativeArrayPassedAsPointerAndSize {
503 NativeArrayPassedAsPointerAndSize() {}
511 TEST(ElementsAreTest, WorksWithNativeArrayPassedAsPointerAndSize) {
512 int array[] = { 0, 1 };
517 NativeArrayPassedAsPointerAndSize helper;
520 helper.Helper(array, 2);
523 TEST(ElementsAreTest, WorksWithTwoDimensionalNativeArray) {
524 const char a2[][3] = {
"hi",
"lo" };
532 TEST(ElementsAreTest, AcceptsStringLiteral) {
533 string array[] = {
"hi",
"one",
"two" };
546 extern const char kHi[];
548 TEST(ElementsAreTest, AcceptsArrayWithUnknownSize) {
552 string array1[] = {
"hi" };
555 string array2[] = {
"ho" };
559 const char kHi[] =
"hi";
563 TEST(ElementsAreTest, MakesCopyOfArguments) {
571 const int array1[] = { 1, 2 };
573 const int array2[] = { 0, 0 };
582 TEST(ElementsAreArrayTest, CanBeCreatedWithValueArray) {
583 const int a[] = { 1, 2, 3 };
592 TEST(ElementsAreArrayTest, CanBeCreatedWithArraySize) {
593 const char* a[] = {
"one",
"two",
"three" };
599 test_vector[0] =
"1";
603 TEST(ElementsAreArrayTest, CanBeCreatedWithoutArraySize) {
604 const char* a[] = {
"one",
"two",
"three" };
609 test_vector[0] =
"1";
613 TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherArray) {
614 const Matcher<string> kMatcherArray[] =
617 vector<string> test_vector;
618 test_vector.push_back(
"one");
619 test_vector.push_back(
"two");
620 test_vector.push_back(
"three");
623 test_vector.push_back(
"three");
627 TEST(ElementsAreArrayTest, CanBeCreatedWithVector) {
628 const int a[] = { 1, 2, 3 };
632 test_vector.push_back(4);
638 TEST(ElementsAreArrayTest, TakesInitializerList) {
639 const int a[5] = { 1, 2, 3, 4, 5 };
645 TEST(ElementsAreArrayTest, TakesInitializerListOfCStrings) {
646 const string a[5] = {
"a",
"b",
"c",
"d",
"e" };
652 TEST(ElementsAreArrayTest, TakesInitializerListOfSameTypedMatchers) {
653 const int a[5] = { 1, 2, 3, 4, 5 };
660 TEST(ElementsAreArrayTest,
661 TakesInitializerListOfDifferentTypedMatchers) {
662 const int a[5] = { 1, 2, 3, 4, 5 };
672 #endif // GTEST_LANG_CXX11 674 TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherVector) {
675 const int a[] = { 1, 2, 3 };
676 const Matcher<int> kMatchers[] = {
Eq(1),
Eq(2),
Eq(3) };
678 const vector<Matcher<int> > expected(
681 test_vector.push_back(4);
685 TEST(ElementsAreArrayTest, CanBeCreatedWithIteratorRange) {
686 const int a[] = { 1, 2, 3 };
693 int*
const null_int = NULL;
700 TEST(ElementsAreArrayTest, WorksWithNativeArray) {
709 TEST(ElementsAreArrayTest, SourceLifeSpan) {
710 const int a[] = { 1, 2, 3 };
713 ElementsAreArrayMatcher<int> matcher_maker =
718 typedef vector<int>::iterator
Iter;
719 for (Iter it = expect.begin(); it != expect.end(); ++it) { *it += 10; }
721 test_vector.push_back(3);
729 MATCHER(IsEven,
"") {
return (
arg % 2) == 0; }
731 TEST(MatcherMacroTest, Works) {
732 const Matcher<int> m = IsEven();
743 MATCHER(IsEven2, negation ?
"is odd" :
"is even") {
744 if ((
arg % 2) == 0) {
747 *result_listener <<
"OK";
750 *result_listener <<
"% 2 == " << (
arg % 2);
758 string(negation ?
"doesn't equal" :
"equals") +
" the sum of " +
760 if (
arg == (x + y)) {
761 *result_listener <<
"OK";
766 if (result_listener->stream() != NULL) {
767 *result_listener->stream() <<
"diff == " << (x + y -
arg);
775 TEST(MatcherMacroTest, DescriptionCanReferenceNegationAndParameters) {
776 const Matcher<int> m1 = IsEven2();
780 const Matcher<int> m2 = EqSumOf(5, 9);
786 TEST(MatcherMacroTest, CanExplainMatchResult) {
787 const Matcher<int> m1 = IsEven2();
791 const Matcher<int> m2 = EqSumOf(1, 2);
800 StaticAssertTypeEq< ::std::string, arg_type>();
804 MATCHER(IsEmptyStringByRef,
"") {
805 StaticAssertTypeEq<const ::std::string&, arg_type>();
809 TEST(MatcherMacroTest, CanReferenceArgType) {
810 const Matcher< ::std::string> m1 = IsEmptyString();
813 const Matcher<const ::std::string&> m2 = IsEmptyStringByRef();
823 TEST(MatcherMacroTest, WorksInNamespace) {
824 Matcher<int> m = matcher_test::IsOdd();
831 return Value(
arg, matcher_test::IsOdd()) &&
arg > 0;
834 TEST(MatcherMacroTest, CanBeComposedUsingValue) {
844 TEST(MatcherPMacroTest, Works) {
845 const Matcher<int> m = IsGreaterThan32And(5);
856 MATCHER_P(_is_Greater_Than32and_, n,
"") {
return arg > 32 &&
arg > n; }
858 TEST(MatcherPMacroTest, GeneratesCorrectDescription) {
859 const Matcher<int> m = _is_Greater_Than32and_(5);
870 class UncopyableFoo {
872 explicit UncopyableFoo(
char value) : value_(value) {}
874 UncopyableFoo(
const UncopyableFoo&);
875 void operator=(
const UncopyableFoo&);
880 MATCHER_P(ReferencesUncopyable, variable,
"") {
return &
arg == &variable; }
882 TEST(MatcherPMacroTest, WorksWhenExplicitlyInstantiatedWithReference) {
883 UncopyableFoo foo1(
'1'), foo2(
'2');
884 const Matcher<const UncopyableFoo&> m =
885 ReferencesUncopyable<const UncopyableFoo&>(foo1);
902 StaticAssertTypeEq<int, foo_type>();
903 StaticAssertTypeEq<long, bar_type>();
904 StaticAssertTypeEq<char, baz_type>();
908 TEST(MatcherPnMacroTest, CanReferenceParamTypes) {
909 EXPECT_THAT(0, ParamTypesAreIntLongAndChar(10, 20L,
'a'));
915 MATCHER_P2(ReferencesAnyOf, variable1, variable2,
"") {
916 return &
arg == &variable1 || &
arg == &variable2;
919 TEST(MatcherPnMacroTest, WorksWhenExplicitlyInstantiatedWithReferences) {
920 UncopyableFoo foo1(
'1'), foo2(
'2'), foo3(
'3');
921 const Matcher<const UncopyableFoo&> m =
922 ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
929 TEST(MatcherPnMacroTest,
930 GeneratesCorretDescriptionWhenExplicitlyInstantiatedWithReferences) {
931 UncopyableFoo foo1(
'1'), foo2(
'2');
932 const Matcher<const UncopyableFoo&> m =
933 ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
939 EXPECT_EQ(
"references any of (1-byte object <31>, 1-byte object <32>)",
945 MATCHER_P2(IsNotInClosedRange, low, hi,
"") {
return arg < low || arg > hi; }
947 TEST(MatcherPnMacroTest, Works) {
948 const Matcher<const long&> m = IsNotInClosedRange(10, 20);
968 return arg == a + b +
c +
d + e +
f;
971 return arg == a + b +
c +
d + e +
f + g;
974 return arg == a + b +
c +
d + e +
f + g + h;
976 MATCHER_P9(EqualsSumOf, a, b,
c,
d, e,
f, g, h, i,
"") {
977 return arg == a + b +
c +
d + e +
f + g + h + i;
979 MATCHER_P10(EqualsSumOf, a, b,
c,
d, e,
f, g, h, i, j,
"") {
980 return arg == a + b +
c +
d + e +
f + g + h + i + j;
983 TEST(MatcherPnMacroTest, CanBeOverloadedOnNumberOfParameters) {
989 EXPECT_THAT(12345, EqualsSumOf(10000, 2000, 300, 40, 5));
991 EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f'));
993 EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g'));
995 EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
998 EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
1001 EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
1016 Not(EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
1019 Not(EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
1022 Not(EqualsSumOf(::
std::string(
"a"),
'b',
'c',
"d",
"e",
'f',
'g',
1028 TEST(MatcherPnMacroTest, WorksForDifferentParameterTypes) {
1029 EXPECT_THAT(123, EqualsSumOf(100L, 20, static_cast<char>(3)));
1032 EXPECT_THAT(124,
Not(EqualsSumOf(100L, 20, static_cast<char>(3))));
1041 char suffix_char =
static_cast<char>(suffix);
1042 return arg == prefix_str + suffix_char;
1045 TEST(MatcherPnMacroTest, SimpleTypePromotion) {
1046 Matcher<std::string> no_promo =
1048 Matcher<const std::string&> promo =
1049 EqConcat(
"foo", static_cast<int>(
't'));
1058 TEST(MatcherPnMacroTest, TypesAreCorrect) {
1060 EqualsSumOfMatcher a0 = EqualsSumOf();
1063 EqualsSumOfMatcherP<int> a1 = EqualsSumOf(1);
1067 EqualsSumOfMatcherP2<int, char> a2 = EqualsSumOf(1,
'2');
1068 EqualsSumOfMatcherP3<int, int, char> a3 = EqualsSumOf(1, 2,
'3');
1069 EqualsSumOfMatcherP4<int, int, int, char> a4 = EqualsSumOf(1, 2, 3,
'4');
1070 EqualsSumOfMatcherP5<int, int, int, int, char> a5 =
1071 EqualsSumOf(1, 2, 3, 4,
'5');
1072 EqualsSumOfMatcherP6<int, int, int, int, int, char> a6 =
1073 EqualsSumOf(1, 2, 3, 4, 5,
'6');
1074 EqualsSumOfMatcherP7<int, int, int, int, int, int, char> a7 =
1075 EqualsSumOf(1, 2, 3, 4, 5, 6,
'7');
1076 EqualsSumOfMatcherP8<int, int, int, int, int, int, int, char> a8 =
1077 EqualsSumOf(1, 2, 3, 4, 5, 6, 7,
'8');
1078 EqualsSumOfMatcherP9<int, int, int, int, int, int, int, int, char> a9 =
1079 EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8,
'9');
1080 EqualsSumOfMatcherP10<int, int, int, int, int, int, int, int, int, char> a10 =
1081 EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, 9,
'0');
1107 TEST(MatcherPnMacroTest, CanUseMatcherTypedParameterInValue) {
1114 TEST(ContainsTest, ListMatchesWhenElementIsInContainer) {
1115 list<int> some_list;
1116 some_list.push_back(3);
1117 some_list.push_back(1);
1118 some_list.push_back(2);
1123 list<string> another_list;
1124 another_list.push_back(
"fee");
1125 another_list.push_back(
"fie");
1126 another_list.push_back(
"foe");
1127 another_list.push_back(
"fum");
1131 TEST(ContainsTest, ListDoesNotMatchWhenElementIsNotInContainer) {
1132 list<int> some_list;
1133 some_list.push_back(3);
1134 some_list.push_back(1);
1138 TEST(ContainsTest, SetMatchesWhenElementIsInContainer) {
1147 set<const char*> another_set;
1148 another_set.insert(
"fee");
1149 another_set.insert(
"fie");
1150 another_set.insert(
"foe");
1151 another_set.insert(
"fum");
1155 TEST(ContainsTest, SetDoesNotMatchWhenElementIsNotInContainer) {
1161 set<const char*> c_string_set;
1162 c_string_set.insert(
"hello");
1166 TEST(ContainsTest, ExplainsMatchResultCorrectly) {
1167 const int a[2] = { 1, 2 };
1168 Matcher<const int (&)[2]> m =
Contains(2);
1175 EXPECT_EQ(
"whose element #0 matches, which is 1 more than 0",
Explain(m, a));
1181 TEST(ContainsTest, DescribesItselfCorrectly) {
1182 Matcher<vector<int> > m =
Contains(1);
1185 Matcher<vector<int> > m2 =
Not(m);
1189 TEST(ContainsTest, MapMatchesWhenElementIsInContainer) {
1190 map<const char*, int> my_map;
1191 const char*
bar =
"a string";
1195 map<string, int> another_map;
1196 another_map[
"fee"] = 1;
1197 another_map[
"fie"] = 2;
1198 another_map[
"foe"] = 3;
1199 another_map[
"fum"] = 4;
1204 TEST(ContainsTest, MapDoesNotMatchWhenElementIsNotInContainer) {
1205 map<int, int> some_map;
1211 TEST(ContainsTest, ArrayMatchesWhenElementIsInContainer) {
1212 const char* string_array[] = {
"fee",
"fie",
"foe",
"fum" };
1216 TEST(ContainsTest, ArrayDoesNotMatchWhenElementIsNotInContainer) {
1217 int int_array[] = { 1, 2, 3, 4 };
1221 TEST(ContainsTest, AcceptsMatcher) {
1222 const int a[] = { 1, 2, 3 };
1227 TEST(ContainsTest, WorksForNativeArrayAsTuple) {
1228 const int a[] = { 1, 2 };
1229 const int*
const pointer = a;
1234 TEST(ContainsTest, WorksForTwoDimensionalNativeArray) {
1235 int a[][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
1242 TEST(AllOfTest, HugeMatcher) {
1245 EXPECT_THAT(0,
testing::AllOf(
_,
_,
_,
_,
_,
_,
_,
_,
_,
1249 TEST(AnyOfTest, HugeMatcher) {
1252 EXPECT_THAT(0,
testing::AnyOf(
_,
_,
_,
_,
_,
_,
_,
_,
_,
1265 MATCHER(M,
"") {
return true; }
1267 template <
typename T1,
typename T2>
1268 bool AllOf(
const T1& t1,
const T2& t2) {
return true; }
1270 TEST(AllOfTest, DoesNotCallAllOfUnqualified) {
1272 M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
1275 template <
typename T1,
typename T2>
bool 1276 AnyOf(
const T1& t1,
const T2& t2) {
return true; }
1278 TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
1280 M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
1286 # pragma warning(pop)
internal::GtMatcher< Rhs > Gt(Rhs x)
#define MATCHER(name, description)
<< DiffStrings(str, arg);
internal::NeMatcher< Rhs > Ne(Rhs x)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)
internal::EqMatcher< T > Eq(T x)
::std::string PrintToString(const T &value)
#define EXPECT_THAT(value, matcher)
Matcher< int > GreaterThan(int n)
#define MATCHER_P4(name, p0, p1, p2, p3, description)
string Explain(const MatcherType &m, const Value &x)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
#define EXPECT_TRUE(condition)
string DescribeNegation(const Matcher< T > &m)
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
internal::RefMatcher< T & > Ref(T &x)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
internal::LtMatcher< Rhs > Lt(Rhs x)
#define MOCK_METHOD2(m,...)
internal::LeMatcher< Rhs > Le(Rhs x)
internal::ElementsAreMatcher< std::tr1::tuple<> > ElementsAre()
def Iter(n, format, sep='')
internal::ElementsAreArrayMatcher< typename::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
std::string Describe(const T &object, const Tabs &tabs)
#define EXPECT_FALSE(condition)
bool Value(const T &value, M matcher)
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
#define MATCHER_P2(name, p0, p1, description)
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
#define TEST(test_case_name, test_name)
#define MATCHER_P3(name, p0, p1, p2, description)
#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)
#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)
#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)
#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)
internal::NamedArg< char > arg(StringRef name, const T &arg)
#define MATCHER_P(name, p0, description)
#define EXPECT_CALL(obj, call)
bool StaticAssertTypeEq()
const internal::AnythingMatcher _
internal::GeMatcher< Rhs > Ge(Rhs x)
#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)
internal::ContainsMatcher< M > Contains(M matcher)
#define GMOCK_ARRAY_SIZE_(a)
#define EXPECT_EQ(expected, actual)