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

coremqtt-agent: Add unit tests for subscription_manager.c #90

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

urutva
Copy link
Contributor

@urutva urutva commented Sep 23, 2024

Description

This PR modifies mocks to support subscription_manager.c, and implements 32 unit tests for the file.
This PR also adds one change to subscription_manager.c's debug logging.

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.

The LogWarning macro was being defined via SdkLogError instead of
SdkLogWarning, which made some unit test cases inaccurate.
LogWarning is now defined using the SdkLogWarning fake function.

Signed-off-by: Reuben Cartwright <[email protected]>
Previously, removeSubscription did not produce any output, nor return a
value if it failed to remove a subscription (e.g. if the subscription
did not exist).
This commit makes removeSubscription return true if successful,
and false otherwise. This commit also documents this change.

Signed-off-by: Reuben Cartwright <[email protected]>
Adds ~35 unit tests covering all functions in the file and some edge
cases.
Also modifies CMakeLists.txt to include the .cpp test file.

Signed-off-by: Reuben Cartwright <[email protected]>
@urutva urutva requested a review from a team as a code owner September 23, 2024 15:16
@aggarg aggarg merged commit 297b348 into FreeRTOS:main Sep 25, 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.

4 participants