Eq() uses the == operator to compare the values:
> Both are of type String,
> which is a class inside our framework that wraps certain string
> implementations.
>
> I would like google mock to use the operator== or compareTo
> implementation of the String class for the matching, but debugging
> tells me none of those methods get called.
Are you sure == isn't called?
> So how does google mock compare the two objects via Eq? I'm worried
> simply comparing the whole objects may fail the test under some
> cirumstances.
>
--
Zhanyong
What compiler/IDE are you using?
You should also be able to specify the equivalent call:
EXPECT_CALL(writer, write(String("abc")));
taking advantage of defaults.
Be careful about your namespaces... google test has a String class in its "internal" namespace.