mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 10:03:49 -06:00
fix: check dolphin fork ipl dumps as a warning
This commit is contained in:
1 parent
4027604bf9
commit
e100e50095
7 files changed
+77
-28
No files matched your search
@@ -235,5 +235,20 @@ class HypseusArchives(unittest.TestCase):
|
||||
self.assertFalse(entry.get("validation"))
|
||||
|
||||
|
||||
class DolphinForksIplDumps(_Probe):
|
||||
"""Load_BS2 compares the IPL's CRC32 with six Redump dumps and only
|
||||
raises "The IPL file is not a known good dump" before booting it
|
||||
(Source/Core/Core/Boot/Boot.cpp:296-337 at Dolphin-MMJR 1b095b6,
|
||||
408-449 at Dolphin-MMJR2 4d0fdb8). The profiles declared the check with
|
||||
no value, so nothing told a known dump from any other."""
|
||||
|
||||
def test_an_unknown_ipl_only_warns(self):
|
||||
for emulator in ("dolphin-mmjr", "dolphin-mmjr2"):
|
||||
with self.subTest(emulator=emulator):
|
||||
data = b"\0" * 2097152
|
||||
self.assertTrue(self.accepts(emulator, "IPL.bin", data))
|
||||
self.assertFalse(self.accepts(emulator, "IPL.bin", data, strict=True))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -52,7 +52,7 @@ class DeclaredHashVerdict(unittest.TestCase):
|
||||
def verdict(self, path, **declared):
|
||||
base = dict(
|
||||
has_strong_hash=True, sha1_candidates=set(), sha256_candidates=set(),
|
||||
md5_list=[], crc_raw="", zipped_file=None, declared_size=None,
|
||||
md5_list=[], crc_candidates=set(), zipped_file=None, declared_size=None,
|
||||
)
|
||||
base.update(declared)
|
||||
return common.declared_hash_verdict(str(path), **base)
|
||||
@@ -82,7 +82,7 @@ class DeclaredHashVerdict(unittest.TestCase):
|
||||
|
||||
def test_crc32_is_checked(self):
|
||||
self.assertEqual(
|
||||
self.verdict(self.wrong, crc_raw=self.d["crc32"]), "hash_mismatch"
|
||||
self.verdict(self.wrong, crc_candidates={self.d["crc32"]}), "hash_mismatch"
|
||||
)
|
||||
|
||||
def test_a_truncated_md5_still_decides(self):
|
||||
@@ -102,7 +102,7 @@ class DeclaredHashVerdict(unittest.TestCase):
|
||||
self.verdict(
|
||||
self.right,
|
||||
sha1_candidates={self.d["sha1"]},
|
||||
crc_raw="deadbeef",
|
||||
crc_candidates={"deadbeef"},
|
||||
),
|
||||
"hash_mismatch",
|
||||
)
|
||||
@@ -110,13 +110,13 @@ class DeclaredHashVerdict(unittest.TestCase):
|
||||
def test_a_size_beside_a_crc32_is_enforced(self):
|
||||
self.assertEqual(
|
||||
self.verdict(
|
||||
self.right, crc_raw=self.d["crc32"], declared_size=len(PAYLOAD)
|
||||
self.right, crc_candidates={self.d["crc32"]}, declared_size=len(PAYLOAD)
|
||||
),
|
||||
"data_dir_hash_exact",
|
||||
)
|
||||
self.assertEqual(
|
||||
self.verdict(
|
||||
self.right, crc_raw=self.d["crc32"], declared_size=len(PAYLOAD) + 1
|
||||
self.right, crc_candidates={self.d["crc32"]}, declared_size=len(PAYLOAD) + 1
|
||||
),
|
||||
"hash_mismatch",
|
||||
)
|
||||
@@ -125,7 +125,7 @@ class DeclaredHashVerdict(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
self.verdict(
|
||||
self.right,
|
||||
crc_raw=self.d["crc32"],
|
||||
crc_candidates={self.d["crc32"]},
|
||||
declared_size=[1, len(PAYLOAD)],
|
||||
),
|
||||
"data_dir_hash_exact",
|
||||
|
||||
Reference in new issue
Block a user