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

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


Source file: io.c
Instrumentation mode: multicondition   Reduced to: MC/DC coverage
TER: 83 % (5/6) structural, 86 % (6/7) statement

Hits/True False Line Source

/* File io.c ------------------------------------------------- */
#include <stdio.h>
#include "io.h"
/* Prompt for an unsigend int value and return it */
Top
10 unsigned io_ask()
{
    unsigned    val;
    int         amount;
10     printf("Enter a number (0 for stop program): ");
10 11     if ((amount = scanf("%u", &val)) <= 0) {
12         val = 0;    /* on 'non sense' input force 0 */
13     }
10 14     return val;
15 }    
16 
17 /* Display an unsigned int value and associated string */
Top
18 void io_report(unsigned val, char* str)
19 {
20     printf("%u %s\n\n", val, str);
21 }
***TER 83% (5/6) of FILE io.c
86% (6/7) statement

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