CTC++ Coverage Report - Execution Profile   #1/3

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


Source file: calc.c
Instrumentation mode: multicondition   Reduced to: MC/DC coverage
TER: 81 % (13/16) structural, 91 % (10/11) statement

Hits/True False Line Source

/* File calc.c ----------------------------------------------- */
#include "calc.h"
/* Tell if the argument is a prime (ret 1) or not (ret 0) */
Top
int is_prime(unsigned val)
{
    unsigned divisor;
    if (val == 1 || val == 2 || val == 3)
    1: T || _ || _
    2: F || T || _
    3: F || F || T
    4: F || F || F
    MC/DC (cond 1): 1 + 4
8     MC/DC (cond 2): 2 - 4
    MC/DC (cond 3): 3 + 4
        return 1;
10     if (val % 2 == 0)
11         return 0;
58 12     for (divisor = 3; divisor < val / 2; divisor += 2)
13     {
58 14         if (val % divisor == 0)
15             return 0;
16     }
17     return 1;
18 }
***TER 81% (13/16) of FILE calc.c
91% (10/11) statement

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