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

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


File: ./calc.c
Instrumentation mode: function-decision-multicondition
TER: 82 % ( 14/ 17)

Start/ End/    
True False - Line Source

  1 /* File calc.c ----------------------------------------------- */
  2 #include "calc.h"
  3 /* Tell if the argument is a prime (ret 1) or not (ret 0) */
Top
  4 int is_prime(unsigned val)
  5 {
  6     unsigned divisor;
  7 
  8     if (val == 1 || val == 2 || val == 3)
   8   T || _ || _
 - 8   F || T || _
   8   F || F || T
   8   F || F || F
   9         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 82% (14/17) of SOURCE FILE calc.c

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