diff --git a/tests/bluetooth/audio/mocks/include/bap_unicast_server.h b/tests/bluetooth/audio/ascs/include/bap_unicast_server.h similarity index 100% rename from tests/bluetooth/audio/mocks/include/bap_unicast_server.h rename to tests/bluetooth/audio/ascs/include/bap_unicast_server.h diff --git a/tests/bluetooth/audio/mocks/include/bap_unicast_server_expects.h b/tests/bluetooth/audio/ascs/include/bap_unicast_server_expects.h similarity index 100% rename from tests/bluetooth/audio/mocks/include/bap_unicast_server_expects.h rename to tests/bluetooth/audio/ascs/include/bap_unicast_server_expects.h diff --git a/tests/bluetooth/audio/ascs/uut/CMakeLists.txt b/tests/bluetooth/audio/ascs/uut/CMakeLists.txt index ad4aba9a501a9..8153d0f9372b4 100644 --- a/tests/bluetooth/audio/ascs/uut/CMakeLists.txt +++ b/tests/bluetooth/audio/ascs/uut/CMakeLists.txt @@ -17,10 +17,13 @@ add_library(uut STATIC ${ZEPHYR_BASE}/subsys/bluetooth/host/uuid.c ${ZEPHYR_BASE}/subsys/logging/log_minimal.c ${ZEPHYR_BASE}/subsys/net/buf_simple.c + bap_unicast_client.c + bap_unicast_server.c ) add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/audio/mocks mocks) target_link_libraries(uut PUBLIC test_interface mocks) +target_include_directories(uut PRIVATE ${ZEPHYR_BASE}/tests/bluetooth/audio/ascs/include) target_compile_options(uut PRIVATE -std=c11 -include ztest.h) diff --git a/tests/bluetooth/audio/mocks/src/bap_unicast_client.c b/tests/bluetooth/audio/ascs/uut/bap_unicast_client.c similarity index 100% rename from tests/bluetooth/audio/mocks/src/bap_unicast_client.c rename to tests/bluetooth/audio/ascs/uut/bap_unicast_client.c diff --git a/tests/bluetooth/audio/mocks/src/bap_unicast_server.c b/tests/bluetooth/audio/ascs/uut/bap_unicast_server.c similarity index 100% rename from tests/bluetooth/audio/mocks/src/bap_unicast_server.c rename to tests/bluetooth/audio/ascs/uut/bap_unicast_server.c diff --git a/tests/bluetooth/audio/mocks/include/cap_commander.h b/tests/bluetooth/audio/cap_commander/include/cap_commander.h similarity index 100% rename from tests/bluetooth/audio/mocks/include/cap_commander.h rename to tests/bluetooth/audio/cap_commander/include/cap_commander.h diff --git a/tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt b/tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt index 007ea55fb9b9d..80508263d6a3e 100644 --- a/tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt +++ b/tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(uut STATIC ${ZEPHYR_BASE}/subsys/net/buf_simple.c bap_broadcast_assistant.c aics.c + cap_commander.c csip.c micp.c vcp.c @@ -25,5 +26,6 @@ add_library(uut STATIC add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/audio/mocks mocks) target_link_libraries(uut PUBLIC test_interface mocks) +target_include_directories(uut PRIVATE ${ZEPHYR_BASE}/tests/bluetooth/audio/cap_commander/include) target_compile_options(uut PRIVATE -std=c11 -include ztest.h) diff --git a/tests/bluetooth/audio/mocks/src/cap_commander.c b/tests/bluetooth/audio/cap_commander/uut/cap_commander.c similarity index 100% rename from tests/bluetooth/audio/mocks/src/cap_commander.c rename to tests/bluetooth/audio/cap_commander/uut/cap_commander.c diff --git a/tests/bluetooth/audio/mocks/include/cap_initiator.h b/tests/bluetooth/audio/cap_initiator/include/cap_initiator.h similarity index 100% rename from tests/bluetooth/audio/mocks/include/cap_initiator.h rename to tests/bluetooth/audio/cap_initiator/include/cap_initiator.h diff --git a/tests/bluetooth/audio/cap_initiator/uut/CMakeLists.txt b/tests/bluetooth/audio/cap_initiator/uut/CMakeLists.txt index 099daf5fc8093..41249c6b89aae 100644 --- a/tests/bluetooth/audio/cap_initiator/uut/CMakeLists.txt +++ b/tests/bluetooth/audio/cap_initiator/uut/CMakeLists.txt @@ -16,11 +16,14 @@ add_library(uut STATIC ${ZEPHYR_BASE}/subsys/bluetooth/common/bt_str.c ${ZEPHYR_BASE}/subsys/logging/log_minimal.c ${ZEPHYR_BASE}/subsys/net/buf_simple.c + bap_unicast_client.c + cap_initiator.c csip.c ) add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/audio/mocks mocks) target_link_libraries(uut PUBLIC test_interface mocks) +target_include_directories(uut PRIVATE ${ZEPHYR_BASE}/tests/bluetooth/audio/cap_initiator/include) target_compile_options(uut PRIVATE -std=c11 -include ztest.h) diff --git a/tests/bluetooth/audio/cap_initiator/uut/bap_unicast_client.c b/tests/bluetooth/audio/cap_initiator/uut/bap_unicast_client.c new file mode 100644 index 0000000000000..ef9ac1328b80e --- /dev/null +++ b/tests/bluetooth/audio/cap_initiator/uut/bap_unicast_client.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Codecoup + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +bool bt_bap_ep_is_unicast_client(const struct bt_bap_ep *ep) +{ + return false; +} + +int bt_bap_unicast_client_config(struct bt_bap_stream *stream, + const struct bt_audio_codec_cfg *codec_cfg) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_qos(struct bt_conn *conn, struct bt_bap_unicast_group *group) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_enable(struct bt_bap_stream *stream, uint8_t meta[], + size_t meta_len) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_metadata(struct bt_bap_stream *stream, uint8_t meta[], + size_t meta_len) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_disable(struct bt_bap_stream *stream) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_connect(struct bt_bap_stream *stream) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_start(struct bt_bap_stream *stream) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_stop(struct bt_bap_stream *stream) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} + +int bt_bap_unicast_client_release(struct bt_bap_stream *stream) +{ + zassert_unreachable("Unexpected call to '%s()' occurred", __func__); + return 0; +} diff --git a/tests/bluetooth/audio/mocks/src/cap_initiator.c b/tests/bluetooth/audio/cap_initiator/uut/cap_initiator.c similarity index 100% rename from tests/bluetooth/audio/mocks/src/cap_initiator.c rename to tests/bluetooth/audio/cap_initiator/uut/cap_initiator.c diff --git a/tests/bluetooth/audio/mocks/CMakeLists.txt b/tests/bluetooth/audio/mocks/CMakeLists.txt index bd46f4d373cc8..ead819b901abc 100644 --- a/tests/bluetooth/audio/mocks/CMakeLists.txt +++ b/tests/bluetooth/audio/mocks/CMakeLists.txt @@ -8,10 +8,6 @@ add_library(mocks STATIC src/bap_stream.c - src/bap_unicast_client.c - src/bap_unicast_server.c - src/cap_commander.c - src/cap_initiator.c src/conn.c src/crypto.c src/fatal.c