OpenCoverage

cycle-check.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/cycle-check.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11static -
12 _Bool-
13-
14is_zero_or_power_of_two (uintmax_t i)-
15{-
16 return
executed 100755 times by 6 tests: return (i & (i - 1)) == 0;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
(i & (i - 1)) == 0;
executed 100755 times by 6 tests: return (i & (i - 1)) == 0;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
100755
17}-
18-
19void-
20cycle_check_init (struct cycle_check_state *state)-
21{-
22 state->chdir_counter = 0;-
23 state->magic = 9827862;-
24}
executed 14208 times by 6 tests: end of block
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
14208
25-
26_Bool-
27-
28cycle_check (struct cycle_check_state *state, struct stat const *sb)-
29{-
30 -
31 ((-
32 state->magic == 9827862-
33 ) ? (void) (0) : __assert_fail (-
34 "state->magic == 9827862"-
35 , "lib/cycle-check.c", 60, __PRETTY_FUNCTION__))-
36 ;-
37-
38-
39-
40-
41 if (state->chdir_counter
state->chdir_counterDescription
TRUEevaluated 95864 times by 5 tests
Evaluated by:
  • chgrp
  • chmod
  • du
  • mv
  • rm
FALSEevaluated 4891 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
&& ((*
(*sb).st_ino =...ev_ino).st_inoDescription
TRUEnever evaluated
FALSEevaluated 95864 times by 5 tests
Evaluated by:
  • chgrp
  • chmod
  • du
  • mv
  • rm
sb).st_ino == (state->dev_ino).st_ino
(*sb).st_ino =...ev_ino).st_inoDescription
TRUEnever evaluated
FALSEevaluated 95864 times by 5 tests
Evaluated by:
  • chgrp
  • chmod
  • du
  • mv
  • rm
&& (*
(*sb).st_dev =...ev_ino).st_devDescription
TRUEnever evaluated
FALSEnever evaluated
sb).st_dev == (state->dev_ino).st_dev
(*sb).st_dev =...ev_ino).st_devDescription
TRUEnever evaluated
FALSEnever evaluated
))
0-95864
42 return
never executed: return 1 ;
never executed: return 1 ;
0
43 1
never executed: return 1 ;
0
44 ;
never executed: return 1 ;
0
45-
46-
47-
48 if (is_zero_or_power_of_two (++(state->chdir_counter))
is_zero_or_pow...hdir_counter))Description
TRUEevaluated 5269 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
FALSEevaluated 95486 times by 4 tests
Evaluated by:
  • chmod
  • du
  • mv
  • rm
)
5269-95486
49 {-
50-
51-
52-
53-
54-
55 if (state->chdir_counter == 0
state->chdir_counter == 0Description
TRUEnever evaluated
FALSEevaluated 5269 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
)
0-5269
56 return
never executed: return 1 ;
never executed: return 1 ;
0
57 1
never executed: return 1 ;
0
58 ;
never executed: return 1 ;
0
59-
60 state->dev_ino.st_dev = sb->st_dev;-
61 state->dev_ino.st_ino = sb->st_ino;-
62 }
executed 5269 times by 6 tests: end of block
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
5269
63-
64 return
executed 100755 times by 6 tests: return 0 ;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
executed 100755 times by 6 tests: return 0 ;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
100755
65 0
executed 100755 times by 6 tests: return 0 ;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
100755
66 ;
executed 100755 times by 6 tests: return 0 ;
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
100755
67}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2