# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); }
If the testcase(condition) always evaluates to true, the code coverage analyzer would complain that the if ( X ) {sqlite3...} statement never evaluates to false and the branch coverage drops below 100%, the converse holds conversely if it was never evaluated to true in the first place.
Only if the code using the testcase macro gets repeatedly called in a way so that the testcase macro evaluates sometimes to true and sometimes to false, the coverage stays at 100%.
sqlite3Coverage() does some dummy work so that the call will not be optimized away by the compiler.
nairboon|6 years ago
sqlite3Coverage() does some dummy work so that the call will not be optimized away by the compiler.