fix: file the Roland ROMs under Roland

The four MT-32 and CM-32L ROMs had a second copy in the Amiga
tree, and the identity exemption that hid the crossing named a
DOSBox tree instead. The copies move next to the Munt ROMs already
under Roland, and each exemption now names the makers it covers,
so a copy under a third one is reported.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 01:25:50 +02:00
1 parent e4960dd4f8
commit da59b20aa6
7 files changed
+211 -182

No files matched your search

+39 -2
View File
@@ -59,12 +59,34 @@ class TestCrossVendorDuplicates(unittest.TestCase):
self._write("Philips/Videopac/O2.bin", b"odyssey")
first = self._scan()
self.assertEqual(len(first), 1)
identity.KNOWN_SHARED[first[0].sha1] = "one machine, two market names"
identity.KNOWN_SHARED[first[0].sha1] = (
frozenset({"Magnavox", "Philips"}), "one machine, two market names"
)
try:
self.assertEqual(self._scan(), [])
finally:
del identity.KNOWN_SHARED[first[0].sha1]
def test_an_exemption_does_not_cover_a_third_maker(self):
# The four Roland ROMs were exempt by content alone, under a reason
# naming a DOSBox tree; the second copies sat in the Amiga tree and
# nothing could tell.
self._write("Magnavox/Odyssey2/o2rom.bin", b"odyssey")
self._write("Philips/Videopac/O2.bin", b"odyssey")
self._write("Commodore/Amiga/odyssey.bin", b"odyssey")
sha1 = self._scan()[0].sha1
identity.KNOWN_SHARED[sha1] = (
frozenset({"Magnavox", "Philips"}), "one machine, two market names"
)
try:
found = self._scan()
self.assertEqual(len(found), 1)
self.assertEqual(
found[0].manufacturers, ["Commodore", "Magnavox", "Philips"]
)
finally:
del identity.KNOWN_SHARED[sha1]
def test_distinct_contents_are_never_grouped(self):
self._write("Commodore/Amiga/kickstart.rom", b"kick")
self._write("Sega/Saturn/cartridge.bin", b"other")
@@ -82,11 +104,26 @@ class TestAllowList(unittest.TestCase):
"""Every exemption carries the reason it is one."""
def test_each_entry_is_a_full_sha1_with_a_reason(self):
for sha1, reason in identity.KNOWN_SHARED.items():
for sha1, (makers, reason) in identity.KNOWN_SHARED.items():
self.assertEqual(len(sha1), 40, sha1)
self.assertTrue(all(c in "0123456789abcdef" for c in sha1), sha1)
self.assertGreaterEqual(len(makers), 2, sha1)
self.assertGreater(len(reason), 20, sha1)
def test_every_exemption_is_still_needed(self):
# An entry whose copies no longer cross its makers exempts nothing
# today and would silently cover the next misfiling.
repo = Path(__file__).resolve().parents[1] / "bios"
if not repo.is_dir():
self.skipTest("bios/ not present")
saved = dict(identity.KNOWN_SHARED)
identity.KNOWN_SHARED.clear()
try:
crossing = {d.sha1 for d in identity.scan(str(repo))}
finally:
identity.KNOWN_SHARED.update(saved)
self.assertEqual(sorted(set(saved) - crossing), [])
def test_the_repository_has_no_unexplained_crossing(self):
repo = Path(__file__).resolve().parents[1] / "bios"
if not repo.is_dir():