diff --git a/tests/test_launcher.py b/tests/test_launcher.py index a082924..7a352a9 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -4,6 +4,7 @@ import os from pathlib import Path import re import socket +import struct import subprocess import sys import tempfile @@ -195,6 +196,28 @@ def main(): assert not found, 'OpenOrbis Linux-valued constant used directly:\n' + '\n'.join(found) print('PASS no OpenOrbis constant with a Linux value is used directly', flush=True) + # The package's param.sfo, as the PS4 reads it (built by `make -C launcher`). + sfo = ROOT / 'build/launcher/pkg/sce_sys/param.sfo' + if not sfo.exists(): + print('SKIP param.sfo checks: build the package first (make -C launcher)', flush=True) + return + data = sfo.read_bytes() + magic, _, keys, values, count = struct.unpack_from('<4sIIII', data) + assert magic == b'\0PSF', magic + fields = {} + for i in range(count): + key_at, kind, length, _, value_at = struct.unpack_from('