GCC Code Coverage Report


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