Something went wrong. Try again.
User-mode emulation for PocketBook 6.1-6.11 firmware on Linux desktop (podman + Wayland)
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849"""Framebuffer smoke tests for the rewritten emulator suite."""
from __future__ import annotations
import time
import pytest
pytestmark = pytest.mark.no_home_reset
def test_frame_dump_metadata(emulator): """frame_dump should expose a complete and sane framebuffer snapshot.""" snapshot = emulator.wait_for_informer_snapshot(timeout=10.0) assert snapshot.task_id is not None assert snapshot.fb_key is not None assert snapshot.fb_size is not None assert snapshot.width is not None assert snapshot.height is not None assert snapshot.depth is not None assert snapshot.stride is not None
assert 100 < snapshot.width < 5000 assert 100 < snapshot.height < 5000 assert snapshot.depth in (8, 16, 24, 32) assert snapshot.stride >= snapshot.width assert snapshot.fb_size >= snapshot.stride * snapshot.height
def test_frame_dump_pixel_hash_stabilises(emulator): """The framebuffer hash should settle at least once across a short sample window.""" samples: list[str] = [] for _ in range(8): output = emulator.run_probe("frame_dump", "--hash").stdout samples.append(_extract_field(output, "pixel_hash")) time.sleep(0.1)
assert any( first == second for first, second in zip(samples, samples[1:], strict=False) ), samples
def _extract_field(text: str, key: str) -> str: for token in text.split(): if token.startswith(f"{key}="): return token.split("=", 1)[1] raise AssertionError(f"key {key!r} not found in {text!r}")