Directory: | cvmfs/ |
---|---|
File: | cvmfs/directory_entry.cc |
Date: | 2025-02-09 02:34:19 |
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 | 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 |
3/6✓ Branch 2 taken 22 times.
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 22 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 22 times.
|
22 | if ((mtime() != other.mtime()) || (mtime_ns() != other.mtime_ns())) { |
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 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (uid() != other.uid()) { |
39 | ✗ | result |= Difference::kUid; | |
40 | } | ||
41 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (gid() != other.gid()) { |
42 | ✗ | result |= Difference::kGid; | |
43 | } | ||
44 | |||
45 | 22 | return result; | |
46 | } | ||
47 | |||
48 | 22 | DirectoryEntryBase::Differences DirectoryEntry::CompareTo( | |
49 | const DirectoryEntry &other) const | ||
50 | { | ||
51 | 22 | Differences result = DirectoryEntryBase::CompareTo(other); | |
52 | |||
53 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (hardlink_group() != other.hardlink_group()) { |
54 | ✗ | result |= Difference::kHardlinkGroup; | |
55 | } | ||
56 |
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()) || |
57 | 22 | (IsNestedCatalogMountpoint() != other.IsNestedCatalogMountpoint()) ) { | |
58 | 1 | result |= Difference::kNestedCatalogTransitionFlags; | |
59 | } | ||
60 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (IsChunkedFile() != other.IsChunkedFile()) { |
61 | ✗ | result |= Difference::kChunkedFileFlag; | |
62 | } | ||
63 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (IsExternalFile() != other.IsExternalFile()) { |
64 | ✗ | result |= Difference::kExternalFileFlag; | |
65 | } | ||
66 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (IsBindMountpoint() != other.IsBindMountpoint()) { |
67 | ✗ | result |= Difference::kBindMountpointFlag; | |
68 | } | ||
69 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (IsHidden() != other.IsHidden()) { |
70 | ✗ | result |= Difference::kHiddenFlag; | |
71 | } | ||
72 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 22 times.
|
22 | if (IsDirectIo() != other.IsDirectIo()) { |
73 | ✗ | result |= Difference::kDirectIoFlag; | |
74 | } | ||
75 | |||
76 | 22 | return result; | |
77 | } | ||
78 | |||
79 | } // namespace catalog | ||
80 |