As I'm not able to define operator
<<
for my class
, google test have option to define PrintTo
function for it Teaching Google Test How to Print Your Values. Thanks RA for the link.
A user can override this behavior for a class type Foo by defining an overload of PrintTo() in the namespace where Foo is defined. We give the user this option as sometimes defining a << operator for Foo is not desirable (e.g. the coding style may prevent doing it, or there is already a << operator but it doesn't do what the user wants).
void PrintTo(const Bar& value, ::std::ostream* os);