Skip to content

ContentStore: Fix totalAllocatedSize on Linux#761

Merged
dcantah merged 1 commit into
apple:mainfrom
yibozhuang:yibo/fix-linux-unit-test
Jun 2, 2026
Merged

ContentStore: Fix totalAllocatedSize on Linux#761
dcantah merged 1 commit into
apple:mainfrom
yibozhuang:yibo/fix-linux-unit-test

Conversation

@yibozhuang
Copy link
Copy Markdown
Contributor

@yibozhuang yibozhuang commented Jun 1, 2026

.totalFileAllocatedSizeKey returns nil for directories on Darwin but on Linux it returns st_blocks * st_blksize (4 KB each) in Foundation. The empty-store test summed three directory inodes on Linux and failed with #expect(size == 0). This change adds filter on the enumerator to regular files only so the totals are content-only and will work for both Darwin and Linux.

.totalFileAllocatedSizeKey returns nil for directories on Darwin
but on Linux it returns `st_blocks * st_blksize` (4 KB each) in
Foundation. The empty-store test summed three directory inodes
on Linux and failed with `#expect(size == 0)`. This change adds
filter on the enumerator to regular files only so the totals
are content-only and will work for both Darwin and Linux.
@dcantah dcantah merged commit 72043f9 into apple:main Jun 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants