sharpemu/tests/SharpEmu.Libs.Tests/Kernel
999sian f84d869795
[Kernel] Match path cache comparisons to host filesystem case sensitivity (#381)
The negative-stat cache and the apr file-size cache memoize host
filesystem probe outcomes, but both were keyed with an ignore-case
comparer while the probes themselves (File.Exists/Directory.Exists/
FileInfo) are case-sensitive on Linux. That aliases distinct paths:

- stat("/app0/DATA.BIN") fails, the miss is cached, and a later
  stat("/app0/Data.bin") is answered NOT_FOUND from the cache without
  ever probing the disk - even though the file exists and the probe
  would succeed.
- sceKernelAprResolveFilepathsToIdsAndFileSizes serves the cached size
  of a case-distinct sibling file instead of the file's own size.

The registered-mount containment guard had the inverse problem: the
ignore-case StartsWith accepted a ".." path that resolves into a
sibling directory differing from the mount root only by case
("…/Save" vs "…/save"), letting guest I/O escape the mount.

All three sites now compare with the host filesystem's semantics:
ordinal-ignore-case on Windows, ordinal elsewhere. Windows behavior is
unchanged. Tests probe actual host filesystem behavior with real temp
files and skip their case-specific sections on case-insensitive hosts.
2026-07-18 13:36:01 +03:00
..
KernelMemoryCompatExportsTests.cs [Kernel] Return largest available direct-memory span (#334) 2026-07-18 02:38:39 +03:00
KernelPathCaseSensitivityTests.cs [Kernel] Match path cache comparisons to host filesystem case sensitivity (#381) 2026-07-18 13:36:01 +03:00
KernelRuntimeCompatExportsTests.cs Fix sceKernelGetTscFrequency disagreeing with the counter on non-Windows hosts (#213) 2026-07-16 00:11:46 +03:00
KernelSocketCompatExportsTests.cs [Kernel] Preserve socket descriptors after failed connect (#343) 2026-07-18 02:40:11 +03:00