mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-05 22:38:38 +08:00
convert_class() copies each scalar across with the same-type copy that convert_old_parameter() uses, and so has the same requirement that the copy be sized by the parameter's type; cover it with the same guard-byte check. convert_parameter_width() locates the old value by scanning storage for an entry carrying the old type, so a successful widening needs storage written by an earlier firmware and cannot be produced in-process. The two tests added for it therefore cover only the paths which decline to convert - no old value in storage, and the parameter already set - and both of those return before the storage read. That read is left uncovered; exercising it would need a way to inject storage in the older format. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>