Open MattPD opened 9 years ago
This (i.e., commit 0c0cf85
) fixed the segmentation faults (cf. Travis CI output for commit 5ea891a
). The test suite is now able to finish -- remaining test failures seem attributable to connection timeouts, which may be local to the testing environment; @DavidTompkins / others, please advise :-)
Seems that
ASSERT_*
versions are more appropriate thanEXPECT_*
here, given the following Google Test guideline:ASSERT_*
versions generate fatal failures when they fail, and abort the current function.EXPECT_*
versions generate nonfatal failures, which don't abort the current function. UsuallyEXPECT_*
are preferred, as they allow more than one failures to be reported in a test. However, you should useASSERT_*
if it doesn't make sense to continue when the assertion in question fails."Source: https://code.google.com/p/googletest/wiki/Primer#Assertions
This replaces
EXPECT_*
withASSERT_*
in the contexts where attempting to continue results in dereferencing a null pointer -- which is undefined behavior: https://stackoverflow.com/questions/6793262/why-dereferencing-a-null-pointer-is-undefined-behaviour