Skip to content

tests: unit: bluetooth: ble_lbs: add tests#764

Open
lemrey wants to merge 1 commit into
nrfconnect:mainfrom
lemrey:ble-lbs-test
Open

tests: unit: bluetooth: ble_lbs: add tests#764
lemrey wants to merge 1 commit into
nrfconnect:mainfrom
lemrey:ble-lbs-test

Conversation

@lemrey
Copy link
Copy Markdown
Contributor

@lemrey lemrey commented Apr 21, 2026

Add unit test suite for ble_lbs.
Depends on #747 , ignore first few commits.

@lemrey lemrey requested review from a team as code owners April 21, 2026 11:43
@NordicBuilder NordicBuilder requested a review from rghaddab April 21, 2026 11:43
@github-actions
Copy link
Copy Markdown

You can find the documentation preview for this PR here.

Comment thread tests/unit/subsys/bluetooth/services/ble_lbs/src/unity_test.c Outdated
Comment thread tests/unit/subsys/bluetooth/services/ble_lbs/src/unity_test.c Outdated
Comment thread tests/unit/subsys/bluetooth/services/ble_lbs/src/unity_test.c Outdated
Comment on lines +194 to +200
/* Success path with full validation of arguments to SoftDevice calls. */
__cmock_sd_ble_uuid_vs_add_Stub(stub_sd_ble_uuid_vs_add_success);
__cmock_sd_ble_gatts_service_add_Stub(stub_sd_ble_gatts_service_add_success);
__cmock_sd_ble_gatts_characteristic_add_Stub(stub_sd_ble_gatts_characteristic_add_success);

nrf_err = ble_lbs_init(&ble_lbs, &cfg);
TEST_ASSERT_EQUAL(NRF_SUCCESS, nrf_err);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be split out.

TEST_ASSERT_EQUAL(ERROR, nrf_err);
}

void test_ble_bls_init(void)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lbs*

Comment on lines +6 to +9
# Redefine Kconfigs used by the tested module that are defined in
# other modules we do not want to enable.
config NRF_SDH_BLE_TOTAL_LINK_COUNT
default 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be needed for this test.

#include <unity.h>

#include <ble.h>
#include <ble_err.h>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ble_err.h header seems to not be needed.

@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

Add unit tests for ble_lbs.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
@github-actions github-actions Bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants