mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: slots read the one gap scope rule
This commit is contained in:
1 parent
d295e51ad6
commit
c13d5c5368
2 files changed
+19
-4
No files matched your search
+5
-4
@@ -28,6 +28,7 @@ from common import (
|
||||
resolve_local_file,
|
||||
runs_standalone,
|
||||
)
|
||||
from validation import outside_gap_scope
|
||||
|
||||
# A profile entry can prove a slot without declaring a hash: Dolphin names no
|
||||
# checksum for the GameCube boot ROM because its source names none, and the
|
||||
@@ -155,10 +156,10 @@ def profile_claims(
|
||||
for entry in profile.get("files") or []:
|
||||
if not isinstance(entry, dict):
|
||||
continue
|
||||
entry_mode = entry.get("mode")
|
||||
if entry_mode == "standalone" and not is_standalone:
|
||||
continue
|
||||
if entry_mode == "libretro" and is_standalone:
|
||||
# The same rule as the gap report and the builder: an entry the
|
||||
# pack never carries (read from the save directory, a
|
||||
# placeholder, a filename-agnostic scan) arbitrates nothing.
|
||||
if outside_gap_scope(entry, is_standalone):
|
||||
continue
|
||||
# A member of a romset is not a file at the BIOS root: the archive
|
||||
# holding it is what occupies a destination, and it is declared
|
||||
|
||||
@@ -183,6 +183,20 @@ class TestConflicts(unittest.TestCase):
|
||||
conflicts = slots.find_conflicts(self._config("m" * 32), profile, REGIONS_DB)
|
||||
self.assertEqual(conflicts, [])
|
||||
|
||||
def test_an_entry_the_pack_never_carries_claims_nothing(self):
|
||||
"""A file read from the save directory, declared with the sha1 of
|
||||
another dump, arbitrated the platform's file off its own path."""
|
||||
profile = {
|
||||
"core": {
|
||||
"files": [
|
||||
{"name": "IPL.bin", "path": "GC/JAP/IPL.bin", "md5": "n" * 32,
|
||||
"load_from": "save_dir"},
|
||||
]
|
||||
}
|
||||
}
|
||||
conflicts = slots.find_conflicts(self._config("m" * 32), profile, REGIONS_DB)
|
||||
self.assertEqual(conflicts, [])
|
||||
|
||||
def test_a_name_only_resolution_asserts_nothing(self):
|
||||
# No hash and no path that the repository carries: the entry is
|
||||
# answered by filename alone and cannot contradict anything.
|
||||
|
||||
Reference in new issue
Block a user