OpenCoverage

operand2sig.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/operand2sig.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3extern int-
4operand2sig (char const *operand, char *signame)-
5{-
6 int signum;-
7-
8 if (((
((unsigned int...d) - '0' <= 9)Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • kill
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • kill
  • timeout
unsigned int) (*operand) - '0' <= 9)
((unsigned int...d) - '0' <= 9)Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • kill
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • kill
  • timeout
)
11-16
9 {-
10 char *endp;-
11 long int l = (-
12 (*__errno_location ()) -
13 = 0, strtol (operand, &endp, 10));-
14 int i = l;-
15 signum = (operand == endp
operand == endpDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
|| *
*endpDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
endp
*endpDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
||
0-11
16 (*
(*__errno_location ())Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
__errno_location ())
(*__errno_location ())Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
0-11
17 || i != l
i != lDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • kill
? -1 : i);
0-11
18-
19 if (signum != -1
signum != -1Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • kill
FALSEnever evaluated
)
0-11
20 {-
21-
22-
23-
24 signum &= signum >= 0xFF
signum >= 0xFFDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • kill
FALSEevaluated 10 times by 1 test
Evaluated by:
  • kill
? 0xFF : 0x7F;
1-10
25 }
executed 11 times by 1 test: end of block
Executed by:
  • kill
11
26 }
executed 11 times by 1 test: end of block
Executed by:
  • kill
11
27 else-
28 {-
29-
30-
31 char *upcased = xstrdup (operand);-
32 char *p;-
33 for (p = upcased; *
*pDescription
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • kill
  • timeout
p
*pDescription
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • kill
  • timeout
; p++)
16-67
34 if (-
35 (
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
__extension__ (__builtin_constant_p (
__builtin_constant_p ( *p )Description
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • kill
  • timeout
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-67
36 *p
__builtin_constant_p ( *p )Description
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • kill
  • timeout
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-67
37 )
__builtin_constant_p ( *p )Description
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • kill
  • timeout
&& !__builtin_constant_p (
!__builtin_con...pqrstuvwxyz" )Description
TRUEnever evaluated
FALSEnever evaluated
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-67
38 "abcdefghijklmnopqrstuvwxyz"
!__builtin_con...pqrstuvwxyz" )Description
TRUEnever evaluated
FALSEnever evaluated
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-49
39 )
!__builtin_con...pqrstuvwxyz" )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( *p ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-49
40 *p
( *p ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-49
41 ) == '\0'
( *p ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
0-49
42 "abcdefghijklmnopqrstuvwxyz"
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
43 ,
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
44 *p
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
45 ) : __builtin_strchr (
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
46 "abcdefghijklmnopqrstuvwxyz"
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
47 ,
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
48 *p
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
49 )))
(__extension__...wxyz" , *p )))Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • kill
  • timeout
18-49
50 )-
51 *
executed 18 times by 2 tests: *p += 'A' - 'a';
Executed by:
  • kill
  • timeout
p += 'A' - 'a';
executed 18 times by 2 tests: *p += 'A' - 'a';
Executed by:
  • kill
  • timeout
18
52-
53-
54-
55 if (!(str2sig (upcased, &signum) == 0
str2sig (upcas... &signum) == 0Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • kill
  • timeout
6-10
56 || (upcased[0] == 'S'
upcased[0] == 'S'Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • kill
  • timeout
&& upcased[1] == 'I'
upcased[1] == 'I'Description
TRUEnever evaluated
FALSEnever evaluated
&& upcased[2] == 'G'
upcased[2] == 'G'Description
TRUEnever evaluated
FALSEnever evaluated
0-6
57 && str2sig (upcased + 3, &signum) == 0
str2sig (upcas... &signum) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)))
0
58 signum = -1;
executed 6 times by 2 tests: signum = -1;
Executed by:
  • kill
  • timeout
6
59-
60 free (upcased);-
61 }
executed 16 times by 2 tests: end of block
Executed by:
  • kill
  • timeout
16
62-
63 if (signum < 0
signum < 0Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • kill
  • timeout
FALSEevaluated 21 times by 2 tests
Evaluated by:
  • kill
  • timeout
|| sig2str (signum, signame) != 0
sig2str (signum, signame) != 0Description
TRUEnever evaluated
FALSEevaluated 21 times by 2 tests
Evaluated by:
  • kill
  • timeout
)
0-21
64 {-
65 error (0, 0, -
66 dcgettext (((void *)0), -
67 "%s: invalid signal"-
68 , 5)-
69 , quote (operand));-
70 return
executed 6 times by 2 tests: return -1;
Executed by:
  • kill
  • timeout
-1;
executed 6 times by 2 tests: return -1;
Executed by:
  • kill
  • timeout
6
71 }-
72-
73 return
executed 21 times by 2 tests: return signum;
Executed by:
  • kill
  • timeout
signum;
executed 21 times by 2 tests: return signum;
Executed by:
  • kill
  • timeout
21
74}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2