OpenCoverage

long-options.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/long-options.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static struct option const long_options[] =-
7{-
8 {"help", -
9 0-
10 , -
11 ((void *)0)-
12 , 'h'},-
13 {"version", -
14 0-
15 , -
16 ((void *)0)-
17 , 'v'},-
18 {-
19 ((void *)0)-
20 , 0, -
21 ((void *)0)-
22 , 0}-
23};-
24-
25-
26-
27-
28void-
29parse_long_options (int argc,-
30 char **argv,-
31 const char *command_name,-
32 const char *package,-
33 const char *version,-
34 void (*usage_func) (int),-
35 ...)-
36{-
37 int c;-
38 int saved_opterr;-
39-
40 saved_opterr = opterr;-
41-
42-
43 opterr = 0;-
44-
45 if (argc == 2
argc == 2Description
TRUEevaluated 399 times by 14 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
FALSEevaluated 5542 times by 12 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • getlimits
  • hostid
  • link
  • nohup
  • sleep
  • tsort
  • users
  • whoami
  • yes
399-5542
46 && (
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 155 times by 14 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
FALSEevaluated 244 times by 7 tests
Evaluated by:
  • dd
  • expr
  • nohup
  • sleep
  • tsort
  • unlink
  • yes
c = getopt_long (argc, argv, "+", long_options,
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 155 times by 14 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
FALSEevaluated 244 times by 7 tests
Evaluated by:
  • dd
  • expr
  • nohup
  • sleep
  • tsort
  • unlink
  • yes
155-244
47 ((void *)0)
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 155 times by 14 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
FALSEevaluated 244 times by 7 tests
Evaluated by:
  • dd
  • expr
  • nohup
  • sleep
  • tsort
  • unlink
  • yes
155-244
48 )) != -1
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 155 times by 14 tests
Evaluated by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
FALSEevaluated 244 times by 7 tests
Evaluated by:
  • dd
  • expr
  • nohup
  • sleep
  • tsort
  • unlink
  • yes
)
155-244
49 {-
50 switch (c)-
51 {-
52 case
executed 42 times by 14 tests: case 'h':
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
'h':
executed 42 times by 14 tests: case 'h':
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
42
53 (*usage_func) (-
54 0-
55 );-
56 break;
never executed: break;
0
57-
58 case
executed 72 times by 14 tests: case 'v':
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
'v':
executed 72 times by 14 tests: case 'v':
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
72
59 {-
60 va_list authors;-
61 -
62 __builtin_va_start(-
63 authors-
64 ,-
65 usage_func-
66 )-
67 ;-
68 version_etc_va (-
69 stdout-
70 , command_name, package, version, authors);-
71 exit (0);
executed 72 times by 14 tests: exit (0);
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
72
72 }-
73-
74 default
executed 41 times by 14 tests: default:
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
code before this statement never executed: default:
executed 41 times by 14 tests: default:
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
:
code before this statement never executed: default:
executed 41 times by 14 tests: default:
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
0-41
75-
76 break;
executed 41 times by 14 tests: break;
Executed by:
  • cksum
  • dd
  • expr
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
41
77 }-
78 }-
79-
80-
81 opterr = saved_opterr;-
82-
83-
84-
85 optind = 0;-
86}
executed 5827 times by 15 tests: end of block
Executed by:
  • cksum
  • dd
  • expr
  • getlimits
  • hostid
  • link
  • logname
  • nohup
  • sleep
  • tsort
  • unlink
  • uptime
  • users
  • whoami
  • yes
5827
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2