-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Increase unit test code coverage of ble/
by 1.3%
#39711
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?
Conversation
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.
Code Review
This pull request adds three new unit tests to TestBtpEngine.cpp
to increase code coverage for BtpEngine
. The new tests verify the initial state of sequence numbers and the behavior of acknowledgment handling. I've suggested a few changes to make the tests more accurate and robust, including correcting a check for unacknowledged data, fixing a typo, and adding an assertion to verify state changes after receiving an acknowledgment. The style guide was followed by correcting a typo.
PR #39711: Size comparison from 230883d to cd294f4 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #39711: Size comparison from 230883d to b34db3f Increases above 0.2%:
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
b34db3f
to
f43bf66
Compare
PR #39711: Size comparison from f56e796 to f43bf66 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
f43bf66
to
1ab9022
Compare
PR #39711: Size comparison from 41c7192 to 1ab9022 Full report (7 builds for cc32xx, qpg, stm32, tizen)
|
PR #39711: Size comparison from 41c7192 to 3ea231f Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
3ea231f
to
d64b7f9
Compare
d64b7f9
to
f43bf66
Compare
PR #39711: Size comparison from 2a72083 to f43bf66 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
- Test that the initial value of the last received sequence number is zero. - Test that the initial value of the newest unacknowledged sent sequence number is zero. - Test that sending a packet updates the unacknowledged sequence number correctly and that receiving an acknowledgment updates the state as expected.
f43bf66
to
38c8043
Compare
PR #39711: Size comparison from 9100f28 to 38c8043 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
029fd85
to
38c8043
Compare
PR #39711: Size comparison from 1f6cf70 to 38c8043 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Summary
This PR adds three new test cases to
TestBtpEngine.cpp
to improve coverage of theBtpEngine
’s sequence number and acknowledgment handling. These tests verify the initial state of sequence numbers and the correct update of state after sending and acknowledging packets.LastReceivedSequenceNumberInitial
verifies that the initial value of the last received sequence number is zero when the BtpEngine is initialized.NewestUnackedSentSequenceNumberInitial
ensures that the newest unacknowledged sent sequence number is zero at initialization.NewestUnackedSentSequenceNumberSend
tests the update of the unacknowledged sent sequence number after sending a packet and receiving an acknowledgment.Related issues
Main issue N 37232
Testing
This PR only adds new unit tests. No changes made to production code.
Coverage Impact of
BtpEngine.cpp
/ble
folderNote: The test cases in this PR target inline functions, which I verified that LCOV correctly identifies and generates symbols for.
Nevertheless, LCOV doesn't seem to be very good at attributing line coverage back to their original definitions for inlined functions (probably when the functions are trivial and the compiler optimizes more aggressively).
As a result:
BtpEngine.cpp
instead ofBtpEngine.h
where those inline functions are defined.