-
Notifications
You must be signed in to change notification settings - Fork 2.3k
src/controller/SetUpCodePairer UTs added. #39214
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
base: master
Are you sure you want to change the base?
src/controller/SetUpCodePairer UTs added. #39214
Conversation
1169771 to
714ad6c
Compare
| namespace Controller { | ||
|
|
||
| namespace { | ||
| namespace PayloadUtils { |
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.
This is the anonymous namespace for a reason: it's an implementation detail.
The only reason there is this method is to steer towards QR or Manual code, based on some text input of the "setup code".
These are already individually tested and likely this method should be moved to the setup payload module (src/setup_payload) rather than be made public here.
Also the tests needs below need to validate both QR code path and manual pairing code path, and also failure cases of invalid codes, if we are going to cover this properly.
So suggestions are:
- Move GetPayload API to src/setup_payload, and rename
SetupPayloadFromString. - Move the unit test over there as well.
- Add tests for manual pairing code (11 and 21 digits)
- Add several cases of failure to decode, including empty string.
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.
thanks for your comment @tcarmelveilleux , I put an "early" DRAFT PR to discuss setup payload from Packed Binary Data Structure.
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.
I'll undo these changes on the anonymous namespace
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.
and likely this method should be moved to the setup payload module
Already happened, in #38924.
|
PR #39214: Size comparison from 58d7600 to 714ad6c Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
| protected: | ||
| }; | ||
|
|
||
| TEST_F(SetUpCodePairerTest, SuccessfulyPopulatesPayloadFromQRSetUpCode) |
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.
This should all be covered by existing setup_payload unit tests, including the ones added in #38728. See src/setup_payload/tests/TestSetupPayload.cpp.
Part of #38043
Added unit test file: src/controller/tests/TestSetUpCodePairer.cpp
Testing
Actually it features new file for adding testing coverage into src/controller folder.