EXPECT_CALL(somemock, SomeCall(_,_,Contains(StrEq("foo"))));
Where the 3rd argument to SomeCall() should be a std::vector<const char*> who
only has 1 element which is "foo".
Unfortunately, that won't compile for me and gives me tons of templating
"no match" errors.
However, I *was* able to do:
EXPECT_CALL(somemock, SomeCall(_,_,ElementsAre(StrEq("foo"))));
And that works exactly as expected. I was also able to write a matcher that
does
return(!strcmp(arg[0], str))
Which also worked....
So am I misunderstanding how Contains() works, or have I stumbled into a bug?
--
Phil Dibowitz
Which version of gmock are you using?
Contains(matcher) is added in revision 164,
http://code.google.com/p/googlemock/source/detail?r=164&path=/trunk/include/gmock/gmock-matchers.h
Therefore it won't work unless you are using a newer revision from the
SVN trunk. It will be included in the next release of gmock. Thanks,
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFKlCfXLBV88STLCDkRAjFkAJ9EI43BoflbE35kkBljBn7HaJZurgCeJMwR
> d+JuCv/TSBgusZf8UvnMJ2k=
> =Zt5N
> -----END PGP SIGNATURE-----
>
>
--
Zhanyong
Aha! Thanks. =)
--
Phil Dibowitz
Site Reliability Engineer - Spam, Abuse, and Delivery
Google - Zurich, Switzerland
Unexpected attachment? http://www/~fixxxer/faq.html