Search code examples
c++unit-testinggoogletestgooglemock

How to fail test in gmock


Is there any macro in gmock that makes test to be failed?

Of course I can write something like this: EXPECT_TRUE(false) but maybe there is a better macro for that like FAIL_TEST() etc.


Solution

  • You can use ADD_FAILURE() to force explicit failure of your unit test