Namespace Serenity.InputGateway.Infrastructure.Devices.Motion.Tests
Classes
HidOutputReportSizeTests
EditMode tests for Serenity.InputGateway.Infrastructure.Devices.Motion.HidOutputReportSize: pins the fallback behaviour both
DualSenseGamepadHIDWithMotion and DualShock4GamepadHIDWithMotion relied on before
this logic was extracted — table-driven over each pad's own fallback size (48 for DualSense, 32
for DualShock 4) so a regression in either device's wiring would show up here. Covers both of
UnityEngine.InputSystem.HID.HID.HIDDeviceDescriptor.FromJson(System.String)'s parse paths: the
minimal single-field JSON below only satisfies its whitespace-free, exactly-ordered predictive
parser by accident of key count, so it actually falls through to the JsonUtility fallback
parser (see Resolve_CapabilitiesWithPositiveOutputReportSize_ReturnsDescriptorSize(int));
Resolve_FullyOrderedDescriptorJson_ReturnsDescriptorSizeViaPredictiveParser() proves the
predictive parser itself with a complete, correctly-ordered descriptor.
TouchpadReportDecoderTests
EditMode tests for Serenity.InputGateway.Infrastructure.Devices.Motion.TouchpadReportDecoder: pins the packed-nibble x/y
reassembly, the active-flag bit inversion, and normalization against each Sony pad's
documented touchpad grid resolution — the pure decoding logic behind
DualShock4GamepadHIDWithMotion / DualSenseGamepadHIDWithMotion's
ITouchpadCapableGamepad implementation.