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