Closed GoogleCodeExporter closed 9 years ago
The idea makes sense. However, we'd like to control the number of macros, as
macros
are bad for many reasons.
Now that Google C++ Mocking Framework (http://code.google.com/p/googlemock/) is
released, there is a better way to do it. We can define a matcher BitEq(x) and
write
ASSERT_THAT(value, BitEq(x))
to assert that the bytes in value and the bytes in x are equal. ASSERT_THAT()
is
already defined by Google Mock, so there's no new macro to add. BitEq(x) can
also be
used in validating mock function arguments, so it's more useful than an
ASSERT_DATAEQ
macro too.
Note that you don't have to use Google Mock's mocking functionality in order to
use
ASSERT_THAT().
Original comment by shiq...@gmail.com
on 16 Dec 2008 at 4:16
This is tracked by Google Mock's issue 6:
http://code.google.com/p/googlemock/issues/detail?id=6
Original comment by shiq...@gmail.com
on 16 Dec 2008 at 6:21
Original issue reported on code.google.com by
j.nick.terry@gmail.com
on 3 Dec 2008 at 9:58