Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 176b9bd0 authored by Chris Manton's avatar Chris Manton
Browse files

test: Comment out unused params net_test_stack_sdp

Bug: 329337321
Test: atest net_test_stack_sdp
Flag: EXEMPT, Test Infrastructure
Change-Id: Ib6c929fba7a99af2fc72730bed1b5cdf451dfd88
parent f6995b81
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2171,5 +2171,4 @@ cc_test {
        "liblog",
    ],
    header_libs: ["libbluetooth_headers"],
    cflags: ["-Wno-unused-parameter"],
}
+7 −8
Original line number Diff line number Diff line
@@ -30,13 +30,13 @@

#include "common/init_flags.h"
#include "internal_include/bt_target.h"
#include "os/log.h"
#include "os/logging/log_adapter.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_psm_types.h"
#include "stack/include/btm_sec_api_types.h"
#include "stack/include/l2c_api.h"
#include "stack/include/sdp_status.h"
#include "stack/sdp/sdpint.h"
#include "types/raw_address.h"

@@ -51,7 +51,7 @@ tSDP_CB sdp_cb;
/*            L O C A L    F U N C T I O N     P R O T O T Y P E S            */
/******************************************************************************/
static void sdp_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
                            UNUSED_ATTR uint16_t psm, uint8_t l2cap_id);
                            uint16_t psm, uint8_t l2cap_id);
static void sdp_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
static void sdp_config_cfm(uint16_t l2cap_cid, uint16_t result,
                           tL2CAP_CFG_INFO* p_cfg);
@@ -121,7 +121,7 @@ void sdp_free(void) {
 *
 ******************************************************************************/
static void sdp_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
                            UNUSED_ATTR uint16_t psm, uint8_t l2cap_id) {
                            uint16_t /* psm */, uint8_t /* l2cap_id */) {
  tCONN_CB* p_ccb = sdpu_allocate_ccb();
  if (p_ccb == NULL) return;

@@ -133,7 +133,7 @@ static void sdp_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
  p_ccb->connection_id = l2cap_cid;
}

static void sdp_on_l2cap_error(uint16_t l2cap_cid, uint16_t result) {
static void sdp_on_l2cap_error(uint16_t l2cap_cid, uint16_t /* result */) {
  tCONN_CB* p_ccb = sdpu_find_ccb_by_cid(l2cap_cid);
  if (p_ccb == nullptr) return;
  sdp_disconnect(p_ccb, SDP_CFG_FAILED);
@@ -214,7 +214,7 @@ static void sdp_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
 * Returns          void
 *
 ******************************************************************************/
static void sdp_config_cfm(uint16_t l2cap_cid, uint16_t initiator,
static void sdp_config_cfm(uint16_t l2cap_cid, uint16_t /* initiator */,
                           tL2CAP_CFG_INFO* p_cfg) {
  sdp_config_ind(l2cap_cid, p_cfg);

@@ -412,8 +412,7 @@ void sdp_disconnect(tCONN_CB* p_ccb, tSDP_REASON reason) {
 * Returns          void
 *
 ******************************************************************************/
static void sdp_disconnect_cfm(uint16_t l2cap_cid,
                               UNUSED_ATTR uint16_t result) {
static void sdp_disconnect_cfm(uint16_t l2cap_cid, uint16_t /* result */) {
  tCONN_CB* p_ccb;

  /* Find CCB based on CID */
+10 −11
Original line number Diff line number Diff line
@@ -41,21 +41,20 @@ class StackSdpMainTest : public ::testing::Test {
  void SetUp() override {
    sdp_init();
    test::mock::stack_l2cap_api::L2CA_ConnectReq2.body =
        [](uint16_t psm, const RawAddress& p_bd_addr, uint16_t sec_level) {
          return ++L2CA_ConnectReq2_cid;
        };
    test::mock::stack_l2cap_api::L2CA_DataWrite.body = [](uint16_t cid,
        [](uint16_t /* psm */, const RawAddress& /* p_bd_addr */,
           uint16_t /* sec_level */) { return ++L2CA_ConnectReq2_cid; };
    test::mock::stack_l2cap_api::L2CA_DataWrite.body = [](uint16_t /* cid */,
                                                          BT_HDR* p_data) {
      osi_free_and_reset((void**)&p_data);
      return 0;
    };
    test::mock::stack_l2cap_api::L2CA_DisconnectReq.body = [](uint16_t cid) {
      return true;
    };
    test::mock::stack_l2cap_api::L2CA_DisconnectReq.body =
        [](uint16_t /* cid */) { return true; };
    test::mock::stack_l2cap_api::L2CA_Register2.body =
        [](uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop,
           tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu,
           uint16_t required_remote_mtu, uint16_t sec_level) {
        [](uint16_t /* psm */, const tL2CAP_APPL_INFO& /* p_cb_info */,
           bool /* enable_snoop */, tL2CAP_ERTM_INFO* /* p_ertm_info */,
           uint16_t /* my_mtu */, uint16_t /* required_remote_mtu */,
           uint16_t /* sec_level */) {
          return 42;  // return non zero
        };
    test::mock::osi_allocator::osi_malloc.body = [](size_t size) {
@@ -144,7 +143,7 @@ TEST_F(StackSdpMainTest, sdp_service_search_request_queuing) {
  ASSERT_EQ(p_ccb2->con_state, SDP_STATE_IDLE);
}

void sdp_callback(const RawAddress& bd_addr, tSDP_RESULT result) {
void sdp_callback(const RawAddress& /* bd_addr */, tSDP_RESULT result) {
  if (result == SDP_SUCCESS) {
    ASSERT_TRUE(SDP_ServiceSearchRequest(addr, sdp_db, nullptr));
  }
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ class StackSdpUtilsTest : public ::testing::Test {
          return btif_config_interface_.GetBinLength(section, key);
        };
    test::mock::osi_properties::osi_property_get_bool.body =
        [](const char* key, bool default_value) { return true; };
        [](const char* /* key */, bool /* default_value */) { return true; };

    localIopMock = std::make_unique<IopMock>();
    localAvrcpVersionMock = std::make_unique<AvrcpVersionMock>();
@@ -581,7 +581,7 @@ TEST_F(StackSdpUtilsTest, check_HFP_version_change_fail) {
  set_hfp_attr(SDP_PROFILE_DESC_LENGTH, ATTR_ID_BT_PROFILE_DESC_LIST,
               UUID_HF_LSB);
  test::mock::osi_properties::osi_property_get_bool.body =
      [](const char* key, bool default_value) { return false; };
      [](const char* /* key */, bool /* default_value */) { return false; };
  EXPECT_CALL(*localIopMock,
              InteropMatchAddrOrName(INTEROP_HFP_1_7_ALLOWLIST, &bdaddr,
                                     &btif_storage_get_remote_device_property))