-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLVReader: Add test for Expect() and handle corner case better #30188
Conversation
Expect(tag) implies that we should actually be positioned on an element. Also make a note about the position of the reader after Next(...)
PR #30188: Size comparison from 94a6f93 to 3c0f5c3 Increases (52 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, psoc6, qpg)
Decreases (3 builds for esp32, linux)
Full report (53 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, psoc6, qpg)
|
This code was not handling CHIP_ERROR_WRONG_TLV_TYPE correctly. Split into separate Next() and Expect() calls to simplify the logic.
PR #30188: Size comparison from 94a6f93 to 70c709a Increases (21 builds for bl602, bl702, bl702l, cc32xx, efr32, k32w, linux, psoc6)
Decreases (62 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, psoc6, qpg, telink)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
writer.Init(buffer, sizeof(buffer)); | ||
TLVType outerContainer; | ||
NL_TEST_ASSERT_SUCCESS(inSuite, writer.StartContainer(AnonymousTag(), kTLVType_Structure, outerContainer)); | ||
NL_TEST_ASSERT_SUCCESS(inSuite, writer.PutBoolean(ContextTag(23), false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest adding a test case for profile specific tags as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Expect(tag) implies that we should actually be positioned on an element. Also make a note about the position of the reader after Next(...)