Overload assert in coverage mode
to avoid polluting the report with untaken branch by the assert macro.
This commit is contained in:
1 parent
48260ac2a6
commit
a6993ab758
1 file changed
+8
@@ -150,6 +150,14 @@
|
|||||||
#undef M_CHECK_DEFAULT_TYPE
|
#undef M_CHECK_DEFAULT_TYPE
|
||||||
#undef M_CHECK_SAME
|
#undef M_CHECK_SAME
|
||||||
#undef isspace
|
#undef isspace
|
||||||
|
#elif defined(BUILD_COVERAGE)
|
||||||
|
// Overload assert to avoid polluting final branch coverage
|
||||||
|
// No need to provide debug outputs. Just abort in case of error.
|
||||||
|
#undef assert
|
||||||
|
static void assert(int cond)
|
||||||
|
{
|
||||||
|
if (!cond) abort();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* For normal builds, empty macros which does nothing */
|
/* For normal builds, empty macros which does nothing */
|
||||||
#define START_COVERAGE
|
#define START_COVERAGE
|
||||||
|
|||||||
Reference in new issue
Block a user