Skip to content

Commit

Permalink
Bluetooth: audio: test: Refactor unit test
Browse files Browse the repository at this point in the history
The unittest for cap commander is refactored, so that tests
for volumecontrol is in its own module.
This avoids the problem of having all tests in one huge file.

Due to their small size the tests for registering callbacks and
discovery haven't been put into their own module.

Signed-off-by: Andries Kruithof <[email protected]>
  • Loading branch information
kruithofa authored and fabiobaltieri committed Mar 26, 2024
1 parent a0ddba5 commit f967e08
Show file tree
Hide file tree
Showing 6 changed files with 1,108 additions and 935 deletions.
3 changes: 3 additions & 0 deletions tests/bluetooth/audio/cap_commander/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ target_sources(testbinary
PRIVATE
${ZEPHYR_BASE}/subsys/bluetooth/host/uuid.c
src/main.c
src/test_common.c
src/test_vcp.c
src/test_micp.c
)
12 changes: 12 additions & 0 deletions tests/bluetooth/audio/cap_commander/include/test_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* test_common.h */

/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

void test_mocks_init(void);
void test_mocks_cleanup(void);

void test_conn_init(struct bt_conn *conn);
Loading

0 comments on commit f967e08

Please sign in to comment.