GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/directory_entry.cc
Date: 2024-04-21 02:33:16
Exec Total Coverage
Lines: 27 37 73.0%
Branches: 28 44 63.6%

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