OpenCoverage

xdectoint.c #2

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-
10uintmax_t-
11xnumtoumax (const char *n_str, int base, uintmax_t min, uintmax_t max,-
12 const char *suffixes, const char *err, int err_exit)-
13{-
14 strtol_error s_err;-
15-
16 uintmax_t tnum;-
17 s_err = xstrtoumax (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-
36-
37-
38 else-
39 -
40 (*
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
41 =
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
42 34
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
43 ;
executed 12 times by 3 tests: (*__errno_location ()) = 34 ;
Executed by:
  • fmt
  • pr
  • split
12
44 }-
45 }
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
46 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
47 -
48 (*
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
49 =
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
50 75
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
51 ;
executed 10 times by 4 tests: (*__errno_location ()) = 75 ;
Executed by:
  • pr
  • split
  • tail
  • truncate
10
52 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
53 -
54 (*
never executed: (*__errno_location ()) = 0;
__errno_location ())
never executed: (*__errno_location ()) = 0;
0
55 = 0;
never executed: (*__errno_location ()) = 0;
0
56-
57 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
58 {-
59-
60 error (err_exit ? err_exit : -
61 1-
62 , -
63 (*__errno_location ()) -
64 == -
65 22 -
66 ? 0 : -
67 (*__errno_location ())-
68 ,-
69 "%s: %s", err, quote (n_str));-
70 }
never executed: end of block
0
71-
72 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
73}-
74-
75-
76-
77-
78-
79-
80uintmax_t-
81xdectoumax (const char *n_str, uintmax_t min, uintmax_t max,-
82 const char *suffixes, const char *err, int err_exit)-
83{-
84 return
executed 4808 times by 15 tests: return xnumtoumax (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
xnumtoumax (n_str, 10, min, max, suffixes, err, err_exit);
executed 4808 times by 15 tests: return xnumtoumax (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
85}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2