Commit 8183c991 authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Benjamin Cabé
Browse files

tests: fix various unit tests warnings

Fix various unit test build warnings, unused variables, set but unused
variables, wrong types etc...

Signed-off-by: default avatarFabio Baltieri <fabiobaltieri@google.com>
parent 274c8485
Loading
Loading
Loading
Loading
+1 −1
Changes for tests/bluetooth/audio/bap_broadcast_source/src/main.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <zephyr/bluetooth/iso.h>
#include <zephyr/fff.h>
#include <zephyr/kernel.h>
#include <zephyr/net/buf.h>
#include <zephyr/net_buf.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/util_macro.h>

+1 −2
Changes for tests/bluetooth/audio/cap_commander/src/test_broadcast_reception.c: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -104,13 +104,12 @@ static void cap_commander_test_broadcast_reception_before(void *f)
static void cap_commander_test_broadcast_reception_after(void *f)
{
	struct cap_commander_test_broadcast_reception_fixture *fixture = f;
	int err;

	bt_cap_commander_unregister_cb(&mock_cap_commander_cb);
	bt_bap_broadcast_assistant_unregister_cb(&fixture->broadcast_assistant_cb);

	/* We need to cleanup since the CAP commander remembers state */
	err = bt_cap_commander_cancel();
	(void)bt_cap_commander_cancel();

	for (size_t i = 0; i < ARRAY_SIZE(fixture->conns); i++) {
		mock_bt_conn_disconnected(&fixture->conns[i], BT_HCI_ERR_REMOTE_USER_TERM_CONN);
+0 −3
Changes for tests/bluetooth/audio/cap_commander/uut/bap_broadcast_assistant.c: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -182,14 +182,11 @@ int bt_bap_broadcast_assistant_set_broadcast_code(
	struct bt_conn *conn, uint8_t src_id,
	const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE])
{
	struct bap_broadcast_assistant_instance *inst;
	struct bt_bap_broadcast_assistant_cb *listener, *next;
	int err;

	zassert_not_null(conn, "conn is NULL");

	inst = inst_by_conn(conn);

	zassert_equal(src_id, RANDOM_SRC_ID, "Invalid src_id");

	err = strncmp((const char *)broadcast_code, BROADCAST_CODE, sizeof(BROADCAST_CODE));
+2 −2
Changes for tests/bluetooth/audio/codec/src/main.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_set_lang)
	struct bt_audio_codec_cfg codec_cfg = BT_AUDIO_CODEC_CFG(
		BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
		{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
	char new_expected_data[] = "deu";
	const uint8_t new_expected_data[] = "deu";
	char expected_data[] = "eng";
	const uint8_t *lang;
	int ret;
@@ -1701,7 +1701,7 @@ ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_set_lang)
	struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP(
		BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
		{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
	char new_expected_data[] = "deu";
	const uint8_t new_expected_data[] = "deu";
	char expected_data[] = "eng";
	const uint8_t *lang;
	int ret;
+0 −3
Changes for tests/bluetooth/controller/ctrl_phy_update/src/main.c: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -589,13 +589,10 @@ ZTEST(phy_periph, test_phy_update_periph_loc_invalid_central)
{
	uint8_t err;
	struct node_tx *tx;
	struct node_rx_pdu *ntf;
	struct pdu_data_llctrl_phy_req req = { .rx_phys = PHY_2M, .tx_phys = PHY_2M };
	uint16_t instant;
	struct pdu_data_llctrl_conn_param_req conn_param_req = {  };

	struct node_rx_pu pu = { .status = BT_HCI_ERR_SUCCESS };

	struct pdu_data_llctrl_phy_upd_ind phy_update_ind = { .c_to_p_phy = PHY_2M,
							      .p_to_c_phy = PHY_2M };

Loading