Skip to content

fix SDO unit tests for param flags UID change#52

Merged
jsphuebner merged 1 commit into
masterfrom
copilot/fix-sdo-unit-tests
Apr 30, 2026
Merged

fix SDO unit tests for param flags UID change#52
jsphuebner merged 1 commit into
masterfrom
copilot/fix-sdo-unit-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

The SDO_INDEX_PARAM_FLAGS (0x2200) handler was changed to look up parameters by UID via NumFromId(subIndex) rather than treating subIndex as a direct PARAM_NUM enum index. The flag tests were still sending the enum index (Param::ocurlim = 2) instead of the UID (ocurlim UID = 22).

Changes

  • test/test_cansdo.cpp: Update sdo_read_param_flags_default, sdo_write_and_read_param_flags, and sdo_write_param_flags_clear to send Param::GetAttrib(Param::ocurlim)->id as the subIndex for 0x2200 SDO requests instead of Param::ocurlim
// Before
SendSdoRequest(SDO_READ, 0x2200, Param::ocurlim, 0);

// After
SendSdoRequest(SDO_READ, 0x2200, Param::GetAttrib(Param::ocurlim)->id, 0);

The invalid-index tests (sdo_read_param_flags_invalid_index, sdo_write_param_flags_invalid_index) are unaffected — they pass Param::PARAM_LAST (= 3), which is not a valid UID, so NumFromId(3) correctly returns PARAM_INVALID under both the old and new handler.

@jsphuebner jsphuebner marked this pull request as ready for review April 30, 2026 07:30
@jsphuebner jsphuebner merged commit b56ec3e into master Apr 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants