Class 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.
Inheritance
HidOutputReportSizeTests
Assembly: Serenity.PlayerInput.Tests.Editor.dll
public sealed class HidOutputReportSizeTests
Constructors
Declaration
public HidOutputReportSizeTests()
Methods
Exercises the JsonUtility fallback path only: the leading space after
{ breaks HIDDeviceDescriptor.FromJson's whitespace-free predictive parser at
its very first token, so it always falls back before reaching this field.
Declaration
public void Resolve_CapabilitiesWithPositiveOutputReportSize_ReturnsDescriptorSize(int fallbackSize)
Parameters
| Type |
Name |
Description |
| int |
fallbackSize |
|
Declaration
public void Resolve_CapabilitiesWithZeroOutputReportSize_ReturnsFallback(int fallbackSize)
Parameters
| Type |
Name |
Description |
| int |
fallbackSize |
|
Declaration
public void Resolve_EmptyCapabilities_ReturnsFallback(int fallbackSize)
Parameters
| Type |
Name |
Description |
| int |
fallbackSize |
|
Exercises the predictive parser path: a complete descriptor with every field in
HIDDeviceDescriptor.FromJson's expected order (vendorId, productId, usage, usagePage,
inputReportSize, outputReportSize, featureReportSize) and no whitespace, which is exactly
what that parser requires to succeed instead of throwing and falling back to
JsonUtility.
Declaration
public void Resolve_FullyOrderedDescriptorJson_ReturnsDescriptorSizeViaPredictiveParser()
Declaration
public void Resolve_NullCapabilities_ReturnsFallback(int fallbackSize)
Parameters
| Type |
Name |
Description |
| int |
fallbackSize |
|