MCPcopy Create free account
hub / github.com/cpputest/cpputest / exitCurrentTest

Method exitCurrentTest

include/CppUTestExt/GTestConvertor.h:207–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 }
206
207 virtual void exitCurrentTest() const
208 {
209 /*
210 * When using GMock, it throws an exception fromt he destructor leaving
211 * the system in an unstable state.
212 * Therefore, when the test fails because of failed gmock expectation
213 * then don't throw the exception, but let it return. Usually this should
214 * already be at the end of the test, so it doesn't matter much
215 */
216
217
218 /*
219 * TODO: We probably want this check here, however the tests fail when putting it there. Also, we'll need to
220 * check how to get all the gTest tests to run within CppUTest. At the moment, the 'death tests' seem to fail
221 * still.
222 *
223 * if (result_.type() == ::testing::TestPartResult::kFatalFailure) {
224 */
225 if (!SimpleString(result_.message()).contains("Actual: never called") &&
226 !SimpleString(result_.message()).contains("Actual function call count doesn't match"))
227 throw CppUTestFailedException();
228
229 }
230 virtual ~GMockTestTerminator()
231 {
232 }

Callers

nothing calls this directly

Calls 3

SimpleStringClass · 0.85
containsMethod · 0.80

Tested by

no test coverage detected