Files
Snapintosh/tools/test-user-zero-group-capture.py
T
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

23 lines
1005 B
Python

# SPDX-License-Identifier: MIT
"""Bind the grouped scan counters to complete audited preparations."""
from pathlib import Path
import runpy
import struct
import unittest
decode=runpy.run_path(str(Path(__file__).with_name('capture-service-profile.py')))['decode_user_zero_groups']
class ZeroGroupCapture(unittest.TestCase):
def test_valid(self):
row=decode(struct.pack('<2Q',6400,5300),100)
self.assertEqual(row['empty_fraction'],5300/6400)
def test_size(self):
for n in (0,15,17):
with self.assertRaises(ValueError):decode(bytes(n),100)
def test_binding(self):
for groups in (0,6399,6401):
with self.assertRaises(ValueError):decode(struct.pack('<2Q',groups,5300),100)
with self.assertRaises(ValueError):decode(struct.pack('<2Q',64,63),0)
def test_paths(self):
for empty in (0,6400,6401):
with self.assertRaises(ValueError):decode(struct.pack('<2Q',6400,empty),100)
if __name__=='__main__':unittest.main()