OpenCoverage

same.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/same.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9_Bool-
10-
11same_name (const char *source, const char *dest)-
12{-
13 return
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
same_nameat (
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
70
14 -100
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
70
15 , source,
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
70
16 -100
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
70
17 , dest);
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest);
Executed by:
  • cp
  • ln
  • mv
70
18}-
19-
20-
21-
22-
23-
24_Bool-
25-
26same_nameat (int source_dfd, char const *source,-
27 int dest_dfd, char const *dest)-
28{-
29-
30 char const *source_basename = last_component (source);-
31 char const *dest_basename = last_component (dest);-
32 size_t source_baselen = base_len (source_basename);-
33 size_t dest_baselen = base_len (dest_basename);-
34 -
35 _Bool -
36 identical_basenames =-
37 (source_baselen == dest_baselen
source_baselen == dest_baselenDescription
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • cp
  • mv
10-60
38 && memcmp (source_basename, dest_basename, dest_baselen) == 0
memcmp (source..._baselen) == 0Description
TRUEevaluated 30 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • cp
  • mv
);
30
39 -
40 _Bool -
41 compare_dirs = identical_basenames;-
42 -
43 _Bool -
44 same = -
45 0-
46 ;-
47 if (compare_dirs
compare_dirsDescription
TRUEevaluated 30 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 40 times by 2 tests
Evaluated by:
  • cp
  • mv
)
30-40
48 {-
49 struct stat source_dir_stats;-
50 struct stat dest_dir_stats;-
51-
52-
53 char *source_dirname = dir_name (source);-
54 int flags = -
55 0x100-
56 ;-
57 if (fstatat (source_dfd, source_dirname, &source_dir_stats, flags) != 0
fstatat (sourc...s, flags) != 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
)
0-30
58 {-
59-
60 error (1, -
61 (*__errno_location ())-
62 , "%s", source_dirname);-
63 }
never executed: end of block
0
64 free (source_dirname);-
65-
66 char *dest_dirname = dir_name (dest);-
67 if (fstatat (dest_dfd, dest_dirname, &dest_dir_stats, flags) != 0
fstatat (dest_...s, flags) != 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
)
0-30
68 {-
69-
70 error (1, -
71 (*__errno_location ())-
72 , "%s", dest_dirname);-
73 }
never executed: end of block
0
74 same = ((
(source_dir_st..._stats).st_inoDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • cp
  • mv
source_dir_stats).st_ino == (dest_dir_stats).st_ino
(source_dir_st..._stats).st_inoDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • cp
  • mv
&& (
(source_dir_st..._stats).st_devDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEnever evaluated
source_dir_stats).st_dev == (dest_dir_stats).st_dev
(source_dir_st..._stats).st_devDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • cp
  • ln
  • mv
FALSEnever evaluated
);
0-26
75-
76-
77 free (dest_dirname);-
78 }
executed 30 times by 3 tests: end of block
Executed by:
  • cp
  • ln
  • mv
30
79-
80 return
executed 70 times by 3 tests: return same;
Executed by:
  • cp
  • ln
  • mv
same;
executed 70 times by 3 tests: return same;
Executed by:
  • cp
  • ln
  • mv
70
81}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2