Skip to content
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

Add freertos_command_pool.c unit tests #89

Merged

Conversation

RC-Repositories
Copy link
Contributor

Description

This PR adds 7 new unit tests for the file freertos_command_pool.c.
Ideally, more tests would have been added.
However, due to how the code was written any tests that filled the command pool would require
(a) exposing structures the code is using internally, so would break if this was changed.
(b) large refactoring of the code, adding to it's public interface.

Additionally, this PR fixes some mocks and modifies test_mqtt_agent_task.cpp to match.

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit adds 7 new unit tests for the file freertos_command_pool.c.

Signed-off-by: Reuben Cartwright <Reuben.Cartwright@arm.com>
FreeRTOSConfig.h has been corrected to #include "fff.h".
Additionally defines configASSERT within FreeRTOS.h.

Signed-off-by: Reuben Cartwright <Reuben.Cartwright@arm.com>
`mqtt_agent_task.h` included `transport_interface_api.h` unnecessarily
for unit testing. This has been extracted into the test file
`test_mqtt_agent_task.cpp` instead.

Signed-off-by: Reuben Cartwright <Reuben.Cartwright@arm.com>
Makes CMakeLists.txt use `BUILD_TESTING` as well as
`CMAKE_CROSSCOMPILING`.

Signed-off-by: Reuben Cartwright <Reuben.Cartwright@arm.com>
This commit adds an explanation in `unit_testing.md` on how
configASSERT is handled in `freertos_command_pool.c` tests and other
test files.
The intended behaviour is that an assertion failure causes the rest of
the code to stop running, but can be handled by a test and does not
stop the rest of the test's checks running.

Signed-off-by: Reuben Cartwright <Reuben.Cartwright@arm.com>
@RC-Repositories RC-Repositories requested a review from a team as a code owner September 19, 2024 15:06
@aggarg aggarg merged commit 9703e49 into FreeRTOS:main Sep 20, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants