ASSERT vs EXPECT

640 views
Skip to first unread message

Piotr Gorak

unread,
Sep 9, 2010, 10:32:19 AM9/9/10
to Google C++ Mocking Framework
Regardless of whether I use ASSERT_THAT(...) or EXPECT_THAT(...), my
test is reported as failed when the condition is not met. According to
the documentation, only ASSERT is supposed to produce a fatal failure.
Can anyone explain this behaviour?

Piotr

Dean Sturtevant

unread,
Sep 9, 2010, 10:36:31 AM9/9/10
to Piotr Gorak, Google C++ Mocking Framework
My understanding is that both ASSERT & EXPECT will cause test failures
if the conditions are not met. The difference is that ASSERT stops the
test in its tracks, EXPECT allows it to continue.
- Dean

Piotr Gorak

unread,
Sep 9, 2010, 10:41:31 AM9/9/10
to Google C++ Mocking Framework
Thanks a lot, this explains the whole thing!

Piotr
Reply all
Reply to author
Forward
0 new messages