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

Commit c8a58629 authored by Chris Manton's avatar Chris Manton
Browse files

Use proper tBTM_STATUS types

Toward readable code

Bug: 163134718
Test: cert
Tag: #refactor

Change-Id: I7727220d4da93279ed215fa366b528cc859b8525
parent 748ee105
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -26,17 +26,13 @@ using bluetooth::Uuid;
// NOTE:
// Local re-implementation of functions to avoid testing of
// unrelated functions/features.
uint8_t BTM_ReadLocalDeviceName(char** p_name) {
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_ReadLocalDeviceName(char** p_name) { return BTM_SUCCESS; }
uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
                                    uint8_t max_num_uuid16,
                                    uint8_t* p_num_uuid16) {
  return BT_EIR_FLAGS_TYPE;
}
uint8_t BTM_WriteEIR(BT_HDR* p_buff) {
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) { return BTM_SUCCESS; }

class BtaCustUuid : public testing::Test {
 protected:
+14 −14
Original line number Diff line number Diff line
@@ -148,48 +148,48 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec,
                                            tBTM_INQ_RESULTS_CB* p_results_cb,
                                            tBTM_CMPL_CB* p_cmpl_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_CancelRemoteDeviceName(void) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_ClearInqDb(const RawAddress* p_bda) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_ReadRemoteDeviceName(
    const RawAddress& raw_address, tBTM_CMPL_CB* callback,
    tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SecBond(const RawAddress& bd_addr,
                                         tBLE_ADDR_TYPE addr_type,
                                         tBT_TRANSPORT transport,
                                         int device_type) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SecBondCancel(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SetConnectability(uint16_t page_mode,
                                                   uint16_t window,
                                                   uint16_t interval) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SetDeviceClass(DEV_CLASS dev_class) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SetDiscoverability(uint16_t discoverable_mode,
                                                    uint16_t window,
                                                    uint16_t interval) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SetEncryption(const RawAddress& bd_addr,
                                               tBT_TRANSPORT transport,
@@ -197,27 +197,27 @@ tBTM_STATUS bluetooth::shim::BTM_SetEncryption(const RawAddress& bd_addr,
                                               void* p_ref_data,
                                               tBTM_BLE_SEC_ACT sec_act) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_SetInquiryMode(uint8_t inquiry_mode) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
                                              tBTM_CMPL_CB* p_cmpl_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::BTM_WriteEIR(BT_HDR* p_buff) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS bluetooth::shim::btm_sec_mx_access_request(
    const RawAddress& bd_addr, bool is_originator,
    uint16_t security_requirement, tBTM_SEC_CALLBACK* p_callback,
    void* p_ref_data) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
uint16_t bluetooth::shim::BTM_GetHCIConnHandle(const RawAddress& remote_bda,
                                               tBT_TRANSPORT transport) {
+8 −8
Original line number Diff line number Diff line
@@ -159,38 +159,38 @@ tACL_CONN* acl_get_connection_from_handle(uint16_t handle) {
tBTM_STATUS BTM_GetLinkSuperTout(const RawAddress& remote_bda,
                                 uint16_t* p_timeout) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, uint8_t* p_role) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_ReadFailedContactCounter(const RawAddress& remote_bda,
                                         tBTM_CMPL_CB* p_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_ReadRSSI(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda,
                            tBT_TRANSPORT transport, tBTM_CMPL_CB* p_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda,
                                 uint16_t timeout) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
uint16_t BTM_GetHCIConnHandle(const RawAddress& remote_bda,
                              tBT_TRANSPORT transport) {
+5 −5
Original line number Diff line number Diff line
@@ -53,26 +53,26 @@ const RawAddress* BTM_ReadScoBdAddr(uint16_t sco_inx) {
tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx,
                                    tBTM_CHG_ESCO_PARAMS* p_parms) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
                          uint16_t pkt_types, uint16_t* p_sco_inx,
                          tBTM_SCO_CB* p_conn_cb, tBTM_SCO_CB* p_disc_cb) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_RegForEScoEvts(uint16_t sco_inx,
                               tBTM_ESCO_CBACK* p_esco_cback) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_RemoveSco(uint16_t sco_inx) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_SetEScoMode(enh_esco_params_t* p_parms) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
uint8_t BTM_GetNumScoLinks(void) {
  mock_function_count_map[__func__]++;
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ bool l2c_link_hci_disc_comp(uint16_t handle, tHCI_REASON reason) {
}
tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
  return 0;
  return BTM_SUCCESS;
}
tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* p_lcb) {
  mock_function_count_map[__func__]++;
Loading