mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: count an alias as declared in the gap report
This commit is contained in:
1 parent
b00352754c
commit
de795262d7
2 files changed
+23
-2
No files matched your search
@@ -402,8 +402,11 @@ def _cross_reference_profile(
|
|||||||
|
|
||||||
archive = f.get("archive")
|
archive = f.get("archive")
|
||||||
|
|
||||||
# Check platform declaration (by name or archive)
|
# Check platform declaration: by name, by an alias the core answers
|
||||||
in_platform = fname in platform_names
|
# to (RetroArch lists amiberry's cd32.rom as kick40060.CD32), or by
|
||||||
|
# archive.
|
||||||
|
answers = {fname, *f.get("aliases", [])}
|
||||||
|
in_platform = bool(answers & platform_names)
|
||||||
if not in_platform and archive:
|
if not in_platform and archive:
|
||||||
in_platform = archive in platform_names
|
in_platform = archive in platform_names
|
||||||
|
|
||||||
|
|||||||
@@ -45,5 +45,23 @@ class FlatDeclaredSet(unittest.TestCase):
|
|||||||
self.assertLess(flat["bk"]["gaps"], per_system["bk"]["gaps"])
|
self.assertLess(flat["bk"]["gaps"], per_system["bk"]["gaps"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class AnAliasIsADeclaration(unittest.TestCase):
|
||||||
|
"""RetroArch lists amiberry's cd32.rom as kick40060.CD32, an alias the
|
||||||
|
profile declares; the gap report still called cd32.rom undeclared."""
|
||||||
|
|
||||||
|
def test_a_file_declared_under_its_alias_is_covered(self):
|
||||||
|
profiles = {"amiberry": {
|
||||||
|
"emulator": "Amiberry", "type": "libretro", "systems": ["commodore-amiga"],
|
||||||
|
"files": [{"name": "cd32.rom", "aliases": ["kick40060.CD32"], "size": 524288}],
|
||||||
|
}}
|
||||||
|
db = {"files": {}, "indexes": {"by_name": {}, "by_md5": {}, "by_crc32": {},
|
||||||
|
"by_path_suffix": {}}}
|
||||||
|
report = cross_reference(
|
||||||
|
profiles, {}, db, {}, {"by_name": {}},
|
||||||
|
all_declared={"kick40060.CD32"},
|
||||||
|
)
|
||||||
|
self.assertEqual(report["amiberry"]["gap_details"], [])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
Reference in new issue
Block a user