On the googletest Primer page I read that ASSERT_EQ()
compares pointers. (which are only equal if they point to the same memory location). If you want to compare C strings, you should use ASSERT_STREQ()
.
ASSERT_STREQ(intended, printer.CStr());
If you want to compare std::string
objects, you can do it this way1:
ASSERT_EQ(intended, printer.Str());