OpenCoverage

xdectoint.c #1

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gl/lib/xdectoint.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10intmax_t-
11xnumtoimax (const char *n_str, int base, intmax_t min, intmax_t max,-
12 const char *suffixes, const char *err, int err_exit)-
13{-
14 strtol_error s_err;-
15-
16 intmax_t tnum;-
17 s_err = xstrtoimax (n_str, -
18 ((void *)0)-
19 , base, &tnum, suffixes);-
20-
21 if (s_err == LONGINT_OK
s_err == LONGINT_OKDescription
TRUEevaluated 4727 times by 13 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
FALSEevaluated 96 times by 17 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • csplit
  • dir
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
  • vdir
)
96-4727
22 {-
23 if (tnum < min
tnum < minDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • pr
  • split
FALSEevaluated 4718 times by 13 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
|| max < tnum
max < tnumDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • fmt
  • split
FALSEevaluated 4713 times by 13 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
)
5-4718
24 {-
25 s_err = LONGINT_OVERFLOW;-
26-
27-
28 if (tnum > 0x7fffffff/2
tnum > 0x7fffffff/2Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • fmt
  • split
FALSEevaluated 12 times by 3 tests
Evaluated by:
  • fmt
  • pr
  • split
)
2-12
29 -
30 (*
executed 2 times by 2 tests: (*__errno_location ()) = 75 ;
Executed by:
  • fmt
  • split
__errno_location ())
executed 2 times by 2 tests: (*__errno_location ()) = 75 ;
Executed by:
  • fmt
  • split
2
31 =
executed 2 times by 2 tests: (*__errno_location ()) = 75 ;
Executed by:
  • fmt
  • split
2
32 75
executed 2 times by 2 tests: (*__errno_location ()) = 75 ;
Executed by:
  • fmt
  • split
2
33 ;
executed 2 times by 2 tests: (*__errno_location ()) = 75 ;
Executed by:
  • fmt
  • split
2
34-
35 else if (tnum <
tnum < (-0x7fffffff - 1) /2Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • pr
0-3
36 (-0x7fffffff - 1)
tnum < (-0x7fffffff - 1) /2Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • pr
0-3
37 /2
tnum < (-0x7fffffff - 1) /2Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • pr
)
0-3
38 -
39 (*
never executed: (*__errno_location ()) = 75 ;
__errno_location ())
never executed: (*__errno_location ()) = 75 ;
0
40 =
never executed: (*__errno_location ()) = 75 ;
0
41 75
never executed: (*__errno_location ()) = 75 ;
0
42 ;
never executed: (*__errno_location ()) = 75 ;
0
43-
44 else-
45 -
46 (*
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
__errno_location ())
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
47 =
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
48 34
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
49 ;
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
50 }-
51 }
executed 4727 times by 13 tests: end of block
Executed by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
4727
52 else if (s_err == LONGINT_OVERFLOW
s_err == LONGINT_OVERFLOWDescription
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • pr
  • split
  • tail
  • truncate
FALSEevaluated 86 times by 17 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • csplit
  • dir
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
  • vdir
)
10-86
53 -
54 (*
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
__errno_location ())
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
55 =
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
56 75
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
57 ;
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
58 else if (s_err == LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW
s_err == LONGI..._WITH_OVERFLOWDescription
TRUEnever evaluated
FALSEevaluated 86 times by 17 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • csplit
  • dir
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
  • vdir
)
0-86
59 -
60 (*
never executed: (*__errno_location ()) = 0;
__errno_location ())
never executed: (*__errno_location ()) = 0;
0
61 = 0;
never executed: (*__errno_location ()) = 0;
0
62-
63 if (s_err != LONGINT_OK
s_err != LONGINT_OKDescription
TRUEevaluated 110 times by 17 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • csplit
  • dir
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
  • vdir
FALSEevaluated 4713 times by 13 tests
Evaluated by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
)
110-4713
64 {-
65-
66 error (err_exit ? err_exit : -
67 1-
68 , -
69 (*__errno_location ()) -
70 == -
71 22 -
72 ? 0 : -
73 (*__errno_location ())-
74 ,-
75 "%s: %s", err, quote (n_str));-
76 }
never executed: end of block
0
77-
78 return
executed 4713 times by 13 tests: return tnum;
Executed by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
tnum;
executed 4713 times by 13 tests: return tnum;
Executed by:
  • b2sum
  • base32
  • base64
  • fmt
  • fold
  • head
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
4713
79}-
80-
81-
82-
83-
84-
85-
86intmax_t-
87xdectoimax (const char *n_str, intmax_t min, intmax_t max,-
88 const char *suffixes, const char *err, int err_exit)-
89{-
90 return
executed 4808 times by 15 tests: return xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);
Executed by:
  • b2sum
  • base32
  • base64
  • csplit
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);
executed 4808 times by 15 tests: return xnumtoimax (n_str, 10, min, max, suffixes, err, err_exit);
Executed by:
  • b2sum
  • base32
  • base64
  • csplit
  • fmt
  • fold
  • head
  • nl
  • nproc
  • pr
  • shred
  • shuf
  • split
  • tail
  • truncate
4808
91}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2