OpenCoverage

yesno.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/yesno.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10_Bool-
11-
12yesno (void)-
13{-
14 -
15 _Bool -
16 yes;-
17-
18-
19 char *response = -
20 ((void *)0)-
21 ;-
22 size_t response_size = 0;-
23 ssize_t response_len = getline (&response, &response_size, -
24 stdin-
25 );-
26-
27 if (response_len <= 0
response_len <= 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • rm
FALSEevaluated 54 times by 3 tests
Evaluated by:
  • cp
  • mv
  • rm
)
1-54
28 yes =
executed 1 time by 1 test: yes = 0 ;
Executed by:
  • rm
1
29 0
executed 1 time by 1 test: yes = 0 ;
Executed by:
  • rm
1
30 ;
executed 1 time by 1 test: yes = 0 ;
Executed by:
  • rm
1
31 else-
32 {-
33-
34-
35 if (response[response_len - 1] == '\n'
response[respo...n - 1] == '\n'Description
TRUEevaluated 54 times by 3 tests
Evaluated by:
  • cp
  • mv
  • rm
FALSEnever evaluated
)
0-54
36 response[response_len - 1] = '\0';
executed 54 times by 3 tests: response[response_len - 1] = '\0';
Executed by:
  • cp
  • mv
  • rm
54
37 yes = (0 < rpmatch (response));-
38 }
executed 54 times by 3 tests: end of block
Executed by:
  • cp
  • mv
  • rm
54
39-
40 free (response);-
41 return
executed 55 times by 3 tests: return yes;
Executed by:
  • cp
  • mv
  • rm
yes;
executed 55 times by 3 tests: return yes;
Executed by:
  • cp
  • mv
  • rm
55
42}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2