Files
Snapintosh/tools/test-panic-contract.py
Acelogic 1510d8c6ce Snapintosh public release
An EL2 monitor/hypervisor and toolchain that boots macOS 27 on the ASUS A16
(Snapdragon X2 Elite), with an Adreno Metal plug-in and IOGPU kext, and
air2ir3, an AIR to Mesa ir3 shader compiler.

MIT, with GPL-2.0 components listed in LICENSE and THIRD_PARTY_NOTICES.md.
No Apple, Qualcomm, ASUS or Microsoft binaries are included.
2026-10-21 21:26:36 -04:00

18 lines
769 B
Python
Executable File

#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
from pathlib import Path
import runpy
import unittest
A=runpy.run_path(str(Path(__file__).with_name('inspect-panic-contract.py')))
class PanicContract(unittest.TestCase):
def test_images(self):self.assertEqual(A['inspect']()['handoff_offset'],'0x198')
def test_single_bit_mutations(self):
for label in ('KERNEL_WORDS','SPTM_WORDS'):
original=A[label]
for va in original:
for bit in range(32):
changed=original.copy();changed[va]^=1<<bit
with self.subTest(va=hex(va),bit=bit),self.assertRaises(ValueError):
A['require_words'](changed.__getitem__,original)
if __name__=='__main__':unittest.main()