-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix lorawantimer unit test #14948
Merged
Patater
merged 8 commits into
ARMmbed:master
from
Patater:lorawan-timer-unittest-fake-fix
Jul 27, 2021
Merged
Fix lorawantimer unit test #14948
Patater
merged 8 commits into
ARMmbed:master
from
Patater:lorawan-timer-unittest-fake-fix
Jul 27, 2021
Conversation
This file contains 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
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
ciarmcom
added
the
release-type: patch
Indentifies a PR as containing just a patch
label
Jul 22, 2021
@Patater, thank you for your changes. |
Remove trailing whitespace from lorawantimer's CMakeLists.txt.
The header equeue_stub.h was missing header guards to enforce single inclusion. Add some header guards.
Use the `--coverage` option instead of manually linking to gcov, as some host platforms (like macOS, FreeBSD) don't have gcov by default and use an llvm equivalent instead.
Patater
force-pushed
the
lorawan-timer-unittest-fake-fix
branch
from
July 22, 2021 14:43
dd26862
to
8994ba6
Compare
Rebased on latest |
@Patater, thank you for your changes. |
Add extern "C" to the equeue_stub declaration to avoid an error when a C file implements the equeue_stub symbol (as we do in equeue_stub.c). Undefined symbols for architecture x86_64: "_equeue_stub", referenced from: Test_LoRaWANTimer_start_Test::TestBody() in Test_LoRaWANTimer.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Patater
force-pushed
the
lorawan-timer-unittest-fake-fix
branch
from
July 22, 2021 17:04
8994ba6
to
56af3f0
Compare
We weren't initialising the mocks correctly, so an MBED_ASSERT failed in `LoRaWANTimer::start` because the "timer_id" was not set.
We previously made up an invalid message type, which was roughly `MCPS_MULTICAST | 0x40`. This causes an MBED_ASSERT failure in the handle_rx function, as it uses an assert to validate the message type passed to it (in convert_to_msg_flag()). Use the valid message type MCPS_MULTICAST instead in the handle_rx unit test.
The CircularBuffer doesn't allow pushing zero elements; you must push at least one. Update the CircularBuffer unit test to avoid invalid use of the CircularBuffer.
Make MBED_ASSERT failures fail the unit test case. Without this, we might not notice the assertion failure as it wouldn't be bubbled up to googletest.
Patater
force-pushed
the
lorawan-timer-unittest-fake-fix
branch
from
July 27, 2021 09:36
56af3f0
to
51b81e0
Compare
Rebased to remove my move from stub event queue to fake event queue, and to cherry-pick in mock initialization from Rob's PR (#14944). |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
0xc0170
approved these changes
Jul 27, 2021
mbedmain
added
release-version: 6.14.0
Release-pending
and removed
release-type: patch
Indentifies a PR as containing just a patch
Release-pending
labels
Aug 18, 2021
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.
Summary of changes
Lorawan timer unit test currently fails because it failed to initialize the mock event queue.
In debugging and fixing this issue, many other broken windows were spotted and fixed, including a broken window whereby any failing
MBED_ASSERT
in a unit test would not bubble up to googletest which was masking that the lorawan timer unit test was at all broken. See commit messages for details on this and other fixes.Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Reviewers