fix(rx): reject undersized typed frames safely

This commit is contained in:
2026-08-28 14:54:06 +03:00
parent 36f234739a
commit c7efd1cb65
4 changed files with 299 additions and 15 deletions

38
tests/run_host_tests.ps1 Normal file
View File

@ -0,0 +1,38 @@
$ErrorActionPreference = 'Stop'
$repo = Split-Path -Parent $PSScriptRoot
$build = Join-Path $PSScriptRoot '.build'
New-Item -ItemType Directory -Force -Path $build | Out-Null
$compiler = if (Test-Path -LiteralPath 'C:\MinGW\bin\g++.exe') {
'C:\MinGW\bin\g++.exe'
} else {
(Get-Command g++ -ErrorAction Stop).Source
}
$common = @(
'-std=c++17', '-Wall', '-Wextra', '-Werror',
'-Wno-unused-parameter', '-Wno-ignored-qualifiers', '-Wno-sign-compare',
'-I', (Join-Path $PSScriptRoot 'arduino_stubs'),
'-I', $repo
)
& $compiler @common `
(Join-Path $PSScriptRoot 'test_timing_contract.cpp') `
(Join-Path $repo 'IR_Encoder.cpp') `
(Join-Path $repo 'IR_config.cpp') `
'-o' (Join-Path $build 'test_timing_contract.exe')
if ($LASTEXITCODE -ne 0) { throw 'timing test build failed' }
& (Join-Path $build 'test_timing_contract.exe')
if ($LASTEXITCODE -ne 0) { throw 'timing test failed' }
& $compiler @common `
(Join-Path $PSScriptRoot 'test_packet_types.cpp') `
(Join-Path $repo 'PacketTypes.cpp') `
(Join-Path $repo 'IR_config.cpp') `
'-o' (Join-Path $build 'test_packet_types.exe')
if ($LASTEXITCODE -ne 0) { throw 'packet test build failed' }
& (Join-Path $build 'test_packet_types.exe')
if ($LASTEXITCODE -ne 0) { throw 'packet test failed' }