PrmDb: use canonical serialized size for record size#4954
Open
hidirektor wants to merge 4 commits intonasa:develfrom
Open
PrmDb: use canonical serialized size for record size#4954hidirektor wants to merge 4 commits intonasa:develfrom
hidirektor wants to merge 4 commits intonasa:develfrom
Conversation
LeStarch
requested changes
Apr 6, 2026
| case 3: | ||
| ASSERT_EVENTS_PrmFileReadError_SIZE(1); | ||
| ASSERT_EVENTS_PrmFileReadError(0, PrmReadError::PARAMETER_ID_SIZE, 0, sizeof(FwPrmIdType) + 1); | ||
| ASSERT_EVENTS_PrmFileReadError(0, PrmReadError::RECORD_SIZE_SIZE, 0, sizeof(FwSizeStoreType) + 1); |
Collaborator
There was a problem hiding this comment.
Why did this change? I believe this loops through each record. Size was in case 2, so my expectation that case 3 remain PARAMETER_ID
Author
There was a problem hiding this comment.
That may seem like an odd change at first, but this test fails by read() call index (m_waits), not by field name. With the size-format update, case 3 now hits a record-size read at the next record boundary, so PrmReadError::RECORD_SIZE_SIZE is the correct expectation
Collaborator
|
To fix the formatting, you can run this command: git diff --name-only devel...HEAD | fprime-util format --stdin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Updates
Svc/PrmDbto use the canonical F Prime serialized size format for the file record size field.U32record-size serialization/deserialization withserializeSize(...)/deserializeSize(...)sizeof(FwSizeStoreType)FW_HAS_16_BIT == 1regression test that:Rationale
This fixes the parameter database file format so it is not tied to host
U32assumptions and is more robust across configurations with different type sizes.The added regression test protects against future format regressions, especially in non-default build configurations such as 16-bit payloads.
Testing/Review Recommendations
Svc/PrmDb/PrmDbImpl.cppSvc/PrmDb/test/ut/PrmDbTester.cppFwSizeStoreType-based sizingFW_HAS_16_BIT == 1buildsFuture Work
AI Usage (see policy)
AI was used for review support.