OpenCoverage

xstrtol-error.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/xstrtol-error.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static void-
4xstrtol_error (enum strtol_error err,-
5 int opt_idx, char c, struct option const *long_options,-
6 char const *arg,-
7 int exit_status)-
8{-
9 char const *hyphens = "--";-
10 char const *msgid;-
11 char const *option;-
12 char option_buffer[2];-
13-
14 switch (err)-
15 {-
16 default
never executed: default:
:
never executed: default:
0
17 abort ();
never executed: abort ();
0
18-
19 case
executed 22 times by 7 tests: case LONGINT_INVALID:
Executed by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
code before this statement never executed: case LONGINT_INVALID:
executed 22 times by 7 tests: case LONGINT_INVALID:
Executed by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
LONGINT_INVALID:
code before this statement never executed: case LONGINT_INVALID:
executed 22 times by 7 tests: case LONGINT_INVALID:
Executed by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
0-22
20 msgid = "invalid %s%s argument '%s'";-
21 break;
executed 22 times by 7 tests: break;
Executed by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
22
22-
23 case
never executed: case LONGINT_INVALID_SUFFIX_CHAR:
LONGINT_INVALID_SUFFIX_CHAR:
never executed: case LONGINT_INVALID_SUFFIX_CHAR:
0
24 case
executed 1 time by 1 test: case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW:
Executed by:
  • pr
LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW:
executed 1 time by 1 test: case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW:
Executed by:
  • pr
1
25 msgid = "invalid suffix in %s%s argument '%s'";-
26 break;
executed 1 time by 1 test: break;
Executed by:
  • pr
1
27-
28 case
executed 1 time by 1 test: case LONGINT_OVERFLOW:
Executed by:
  • pr
LONGINT_OVERFLOW:
executed 1 time by 1 test: case LONGINT_OVERFLOW:
Executed by:
  • pr
1
29 msgid = "%s%s argument '%s' too large";-
30 break;
executed 1 time by 1 test: break;
Executed by:
  • pr
1
31 }-
32-
33 if (opt_idx < 0
opt_idx < 0Description
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • df
  • du
  • od
FALSEevaluated 17 times by 7 tests
Evaluated by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
)
7-17
34 {-
35 hyphens -= opt_idx;-
36 option_buffer[0] = c;-
37 option_buffer[1] = '\0';-
38 option = option_buffer;-
39 }
executed 7 times by 3 tests: end of block
Executed by:
  • df
  • du
  • od
7
40 else-
41 option = long_options[opt_idx].name;
executed 17 times by 7 tests: option = long_options[opt_idx].name;
Executed by:
  • df
  • dir
  • du
  • od
  • pr
  • sort
  • vdir
17
42-
43 error (exit_status, 0, -
44 dcgettext (((void *)0), -
45 msgid-
46 , 5)-
47 , hyphens, option, arg);-
48}
never executed: end of block
0
49-
50-
51-
52void-
53xstrtol_fatal (enum strtol_error err,-
54 int opt_idx, char c, struct option const *long_options,-
55 char const *arg)-
56{-
57 xstrtol_error (err, opt_idx, c, long_options, arg, exit_failure);-
58 abort ();
never executed: abort ();
0
59}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2