Block Code Coverage
Test RealTime - User Guide
Some C statements are considered
non coverable
if they follow a terminal
instruction, a CONTINUE, or a BREAK, and are not a GOTO label. Code Coverage
detects non-coverable statements during instrumentation and produces a warning
message that specifies the source file and line location of each non-coverable
statement.
-
Note User functions whose purpose is to terminate execution unconditionally
are not evaluated. Furthermore, Code Coverage does not statically analyze
exit conditions for loops to check whether they are infinite. As a result, FOR ...
WHILE and DO ... WHILE loops are always assumed to be
non-terminal
, able
to resume program control in sequence.
C++ Coverage
Block Code Coverage
When analyzing C++ source code, Code Coverage can provide the following block
coverage types:
·
Statement Blocks
·
Statement Blocks and Decisions
·
Statement Blocks, Decisions, and Loops
Statement Blocks
Statement blocks are the C++ function or method main blocks, blocks introduced by
decision instructions:
·
THEN and ELSE FOR IF, WHILE and DO ... WHILE blocks
·
non-empty blocks introduced by SWITCH CASE or DEFAULT statements
·
true and false outcomes of ternary expressions (
<expr>
?
<expr>
:
<expr>
)
·
TRY blocks and any associated catch handler
·
blocks following a potentially terminal statement.
int main ( ) /* -
BLOCK */
{
try {
if ( 0 )
{
func ( "Hello" );
}
else
{
throw UnLucky ( );
}
}
catch ( Overflow & o ) {
cout << o.String << '\n';
}
46