fix: settle a slot in any case where case folds

declaration_settles tested the exact-case name before the slot, so on a
filesystem that folds case a declaration spelled otherwise never settled
the core's file: RetroBat's 32X_G_BIOS.BIN left BlastEm's 32X_G_BIOS.bin
undeclared, and verify counted ten such entries as core files. A slot a
case-insensitive platform fills now settles the entry whatever the
spelling (case_folded_slots), the slot arbitration judging its bytes as
for the exact name. Lakka and RetroPie, which keep both names, are
unchanged. Measured: 10 entries settle on RetroBat, 21 on RetroArch.

generate_site.py builds its gap report through cross_reference() without
the folded slots; it needs folded_declared_slots() passed in the same way
as the command line now does.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 05:38:11 +02:00
1 parent 184c822e6e
commit 82a3e44afd
5 files changed
+101 -16

No files matched your search

+22 -10
View File
@@ -98,7 +98,7 @@ class TheReportSaysSo(unittest.TestCase):
name: verify_platform(
load_platform_config(name, "platforms"), db, "emulators", profiles
)
for name in ("retroarch", "retrobat")
for name in ("retroarch", "retrobat", "lakka")
}
finally:
os.chdir(previous)
@@ -109,16 +109,28 @@ class TheReportSaysSo(unittest.TestCase):
return u
self.skipTest(f"{emulator} {path} is not in the cross-reference")
def test_a_case_twin_with_other_bytes_is_left_out(self):
entry = self._entry("NP2kai", "np2kai/bios.rom", "retrobat")
self.assertIs(entry.get("in_pack"), False)
self.assertIn("another case", entry.get("omitted", ""))
def _listed(self, emulator: str, path: str, platform: str) -> bool:
return any(
u.get("emulator") == emulator and (u.get("path") or u.get("name")) == path
for u in self.results[platform]["undeclared_files"]
)
def test_a_twin_with_the_same_bytes_serves_the_core(self):
# MesenCE opens bios.col, and RetroArch's pack folds it onto BIOS.col,
# the same bytes, which serves the core on a folding filesystem.
entry = self._entry("MesenCE", "bios.col")
self.assertIsNot(entry.get("in_pack"), False)
def test_a_declaration_in_another_case_settles_the_slot(self):
"""On a filesystem that folds case the platform's file at the slot is
the one the core opens, whatever its spelling, and the slot
arbitration judges its bytes. Listed as a core file, RetroBat's
32X_G_BIOS.BIN counted BlastEm's 32X_G_BIOS.bin in the pack twice."""
for platform, emulator, path in (
("retrobat", "NP2kai", "np2kai/bios.rom"),
("retrobat", "BlastEm", "32X_G_BIOS.bin"),
("retroarch", "MesenCE", "bios.col"),
):
with self.subTest(platform=platform, path=path):
self.assertFalse(self._listed(emulator, path, platform))
def test_a_filesystem_keeping_both_names_reports_the_other(self):
"""Lakka runs on Linux, where bios.col and BIOS.col are two files."""
self.assertTrue(self._listed("MesenCE", "bios.col", "lakka"))
def test_a_directory_under_a_packed_file_is_left_out(self):
entry = self._entry("nSide (SFC Balanced)", "SGB1.sfc/lr35902.boot.rom")