GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/directory_entry.cc
Date: 2025-06-22 02:36:02
Exec Total Coverage
Lines: 29 41 70.7%
Branches: 32 52 61.5%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #include "directory_entry.h"
6
7 namespace catalog {
8
9 1078 DirectoryEntryBase::Differences DirectoryEntryBase::CompareTo(
10 const DirectoryEntryBase &other) const {
11 1078 Differences result = Difference::kIdentical;
12
13
3/6
✓ Branch 2 taken 1078 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1078 times.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1078 times.
1078 if (name() != other.name()) {
14 result |= Difference::kName;
15 }
16
2/2
✓ Branch 2 taken 98 times.
✓ Branch 3 taken 980 times.
1078 if (linkcount() != other.linkcount()) {
17 98 result |= Difference::kLinkcount;
18 }
19
2/2
✓ Branch 2 taken 98 times.
✓ Branch 3 taken 980 times.
1078 if (size() != other.size()) {
20 98 result |= Difference::kSize;
21 }
22
2/2
✓ Branch 2 taken 49 times.
✓ Branch 3 taken 1029 times.
1078 if (mode() != other.mode()) {
23 49 result |= Difference::kMode;
24 }
25
3/6
✓ Branch 2 taken 1078 times.
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1078 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1078 times.
1078 if ((mtime() != other.mtime()) || (mtime_ns() != other.mtime_ns())) {
26 result |= Difference::kMtime;
27 }
28
4/6
✓ Branch 2 taken 1078 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1078 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 49 times.
✓ Branch 10 taken 1029 times.
1078 if (symlink() != other.symlink()) {
29 49 result |= Difference::kSymlink;
30 }
31
2/4
✓ Branch 3 taken 1078 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1078 times.
1078 if (checksum() != other.checksum()) {
32 result |= Difference::kChecksum;
33 }
34
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (HasXattrs() != other.HasXattrs()) {
35 result |= Difference::kHasXattrsFlag;
36 }
37
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (uid() != other.uid()) {
38 result |= Difference::kUid;
39 }
40
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (gid() != other.gid()) {
41 result |= Difference::kGid;
42 }
43
44 1078 return result;
45 }
46
47 1078 DirectoryEntryBase::Differences DirectoryEntry::CompareTo(
48 const DirectoryEntry &other) const {
49 1078 Differences result = DirectoryEntryBase::CompareTo(other);
50
51
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (hardlink_group() != other.hardlink_group()) {
52 result |= Difference::kHardlinkGroup;
53 }
54 1078 if ((IsNestedCatalogRoot() != other.IsNestedCatalogRoot())
55
5/6
✓ Branch 0 taken 1078 times.
✗ Branch 1 not taken.
✓ Branch 4 taken 49 times.
✓ Branch 5 taken 1029 times.
✓ Branch 6 taken 49 times.
✓ Branch 7 taken 1029 times.
1078 || (IsNestedCatalogMountpoint() != other.IsNestedCatalogMountpoint())) {
56 49 result |= Difference::kNestedCatalogTransitionFlags;
57 }
58
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (IsChunkedFile() != other.IsChunkedFile()) {
59 result |= Difference::kChunkedFileFlag;
60 }
61
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (IsExternalFile() != other.IsExternalFile()) {
62 result |= Difference::kExternalFileFlag;
63 }
64
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (IsBindMountpoint() != other.IsBindMountpoint()) {
65 result |= Difference::kBindMountpointFlag;
66 }
67
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (IsHidden() != other.IsHidden()) {
68 result |= Difference::kHiddenFlag;
69 }
70
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1078 times.
1078 if (IsDirectIo() != other.IsDirectIo()) {
71 result |= Difference::kDirectIoFlag;
72 }
73
74 1078 return result;
75 }
76
77 } // namespace catalog
78