CTC++ Coverage Report- Execution Profile#5/7

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Index | No Index


Source file:F:\ctcwork\v81\doc\examples\calc.c
Instrumentation mode:multicondition+inclusive_timingReduced to:MC/DC coverage
TER:63 % (10/16) structural,82 % (9/11) statement

Hits/TrueFalseLineSource
1/* File calc.c ----------------------------------------------- */
2#include "calc.h"
3/* Tell if the argument is a prime (ret 1) or not (ret 0) */
Top
34int is_prime(unsigned val)
5{
6    unsigned divisor;
7
128    if (val == 1 || val == 2 || val == 3)
08    1: T || _ || _
18    2: F || T || _
08    3: F || F || T
28    4: F || F || F
-8    MC/DC (cond 1): 1 - 4
+8    MC/DC (cond 2): 2 + 4
-8    MC/DC (cond 3): 3 - 4
19        return 1;
1110    if (val % 2 == 0)
111        return 0;
0112    for (divisor = 3; divisor < val / 2; divisor += 2)
13    {
0014        if (val % divisor == 0)
015            return 0;
16    }
117    return 1;
18}
***TER63 % (10/16) of FILE calc.c
82 % (9/11) statement

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Top | Index | No Index