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

Commit ee6f7728 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Add various stack/test/common/mock_ am: b2603e92 am: 634dc157 am: 932e8257

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1515034

Change-Id: Ic586c9a30e738f0773e2ea94f472c6ef4d43ea5f
parents dde3662c 932e8257
Loading
Loading
Loading
Loading
+114 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:53
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include "bta/dm/bta_dm_int.h"
#include "types/raw_address.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

void BTA_dm_acl_down(const RawAddress bd_addr, tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
}
void BTA_dm_acl_up(const RawAddress bd_addr, tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
}
void BTA_dm_on_hw_off() { mock_function_count_map[__func__]++; }
void BTA_dm_on_hw_on() { mock_function_count_map[__func__]++; }
void BTA_dm_report_role_change(const RawAddress bd_addr, uint8_t new_role,
                               uint8_t hci_status) {
  mock_function_count_map[__func__]++;
}
void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) {
  mock_function_count_map[__func__]++;
}
void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
                 tBT_TRANSPORT transport, int device_type) {
  mock_function_count_map[__func__]++;
}
void bta_dm_bond_cancel(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
}
void bta_dm_ci_rmt_oob_act(std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg) {
  mock_function_count_map[__func__]++;
}
void bta_dm_close_acl(const RawAddress& bd_addr, bool remove_dev,
                      tBT_TRANSPORT transport) {
  mock_function_count_map[__func__]++;
}
void bta_dm_confirm(const RawAddress& bd_addr, bool accept) {
  mock_function_count_map[__func__]++;
}
void bta_dm_deinit_cb(void) { mock_function_count_map[__func__]++; }
void bta_dm_disable() { mock_function_count_map[__func__]++; }
void bta_dm_disc_result(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_disc_rmt_name(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_discover(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_free_sdp_db() { mock_function_count_map[__func__]++; }
void bta_dm_init_cb(void) { mock_function_count_map[__func__]++; }
void bta_dm_inq_cmpl(uint8_t num) { mock_function_count_map[__func__]++; }
void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg) {
  mock_function_count_map[__func__]++;
}
void bta_dm_process_remove_device(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
}
void bta_dm_queue_disc(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_queue_search(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_remove_device(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
}
void bta_dm_rmt_name(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_sdp_result(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_search_cancel() { mock_function_count_map[__func__]++; }
void bta_dm_search_cancel_cmpl() { mock_function_count_map[__func__]++; }
void bta_dm_search_cancel_notify() { mock_function_count_map[__func__]++; }
void bta_dm_search_clear_queue() { mock_function_count_map[__func__]++; }
void bta_dm_search_cmpl() { mock_function_count_map[__func__]++; }
void bta_dm_search_result(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_search_start(tBTA_DM_MSG* p_data) {
  mock_function_count_map[__func__]++;
}
void bta_dm_set_dev_name(const std::vector<uint8_t>& name) {
  mock_function_count_map[__func__]++;
}
+96 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:17
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <stddef.h>
#include "bt_common.h"
#include "bta/include/bta_api.h"
#include "bta/include/utl.h"
#include "bta/sys/bta_sys.h"
#include "bta/sys/bta_sys_int.h"
#include "osi/include/osi.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

void bta_sys_app_close(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_app_open(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_busy(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_collision_register(uint8_t bta_id, tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_conn_close(uint8_t id, uint8_t app_id,
                        const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_conn_open(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_idle(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_notify_collision(const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_notify_role_chg(const RawAddress& peer_addr, uint8_t new_role,
                             uint8_t hci_status) {
  mock_function_count_map[__func__]++;
}
void bta_sys_pm_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_rm_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_role_chg_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_close(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_open(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_unuse(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_use(UNUSED_ATTR uint8_t id, uint8_t app_id,
                     const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
+156 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:51
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <cstdint>
#include "bta/include/bta_api.h"
#include "include/hardware/bluetooth.h"
#include "types/raw_address.h"

struct uid_set_t;

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

bool btif_dm_pairing_is_busy() {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod) {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_cod_hid(const RawAddress* remote_bdaddr) {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_sdp_bl(const RawAddress* remote_bdaddr) {
  mock_function_count_map[__func__]++;
  return false;
}
bt_status_t btif_dm_get_adapter_property(bt_property_t* prop) {
  mock_function_count_map[__func__]++;
  return BT_STATUS_SUCCESS;
}
bt_status_t btif_in_execute_service_request(tBTA_SERVICE_ID service_id,
                                            bool b_enable) {
  mock_function_count_map[__func__]++;
  return BT_STATUS_SUCCESS;
}
uint16_t btif_dm_get_connection_state(const RawAddress* bd_addr) {
  mock_function_count_map[__func__]++;
  return 0;
}
void BTIF_dm_disable() { mock_function_count_map[__func__]++; }
void BTIF_dm_enable() { mock_function_count_map[__func__]++; }
void BTIF_dm_on_hw_error() { mock_function_count_map[__func__]++; }
void BTIF_dm_report_inquiry_status_change(uint8_t status) {
  mock_function_count_map[__func__]++;
}
void bte_dm_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
  mock_function_count_map[__func__]++;
}
void btif_ble_receiver_test(uint8_t rx_freq) {
  mock_function_count_map[__func__]++;
}
void btif_ble_test_end() { mock_function_count_map[__func__]++; }
void btif_ble_transmitter_test(uint8_t tx_freq, uint8_t test_data_len,
                               uint8_t packet_payload) {
  mock_function_count_map[__func__]++;
}
void btif_debug_bond_event_dump(int fd) { mock_function_count_map[__func__]++; }
void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req, bool is_consent) {
  mock_function_count_map[__func__]++;
}
void btif_dm_cancel_bond(const RawAddress bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_cancel_discovery(void) { mock_function_count_map[__func__]++; }
void btif_dm_cleanup(void) { mock_function_count_map[__func__]++; }
void btif_dm_create_bond(const RawAddress bd_addr, int transport) {
  mock_function_count_map[__func__]++;
}
void btif_dm_create_bond_out_of_band(const RawAddress bd_addr, int transport,
                                     const bt_out_of_band_data_t oob_data) {
  mock_function_count_map[__func__]++;
}
void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable) {
  mock_function_count_map[__func__]++;
}
void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask,
                                Octet16* p_er,
                                tBTA_BLE_LOCAL_ID_KEYS* p_id_keys) {
  mock_function_count_map[__func__]++;
}
void btif_dm_get_remote_services(RawAddress remote_addr, const int transport) {
  mock_function_count_map[__func__]++;
}
void btif_dm_hh_open_failed(RawAddress* bdaddr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_init(uid_set_t* set) { mock_function_count_map[__func__]++; }
void btif_dm_load_ble_local_keys(void) { mock_function_count_map[__func__]++; }
void btif_dm_on_disable() { mock_function_count_map[__func__]++; }
void btif_dm_pin_reply(const RawAddress bd_addr, uint8_t accept,
                       uint8_t pin_len, bt_pin_code_t pin_code) {
  mock_function_count_map[__func__]++;
}
void btif_dm_proc_io_req(tBTM_AUTH_REQ* p_auth_req, bool is_orig) {
  mock_function_count_map[__func__]++;
}
void btif_dm_proc_io_rsp(UNUSED_ATTR const RawAddress& bd_addr,
                         tBTM_IO_CAP io_cap, UNUSED_ATTR tBTM_OOB_DATA oob_data,
                         tBTM_AUTH_REQ auth_req) {
  mock_function_count_map[__func__]++;
}
void btif_dm_read_energy_info() { mock_function_count_map[__func__]++; }
void btif_dm_remove_ble_bonding_keys(void) {
  mock_function_count_map[__func__]++;
}
void btif_dm_remove_bond(const RawAddress bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_set_oob_for_io_req(tBTM_OOB_DATA* p_has_oob_data) {
  mock_function_count_map[__func__]++;
}
void btif_dm_set_oob_for_le_io_req(const RawAddress& bd_addr,
                                   tBTM_OOB_DATA* p_has_oob_data,
                                   tBTM_LE_AUTH_REQ* p_auth_req) {
  mock_function_count_map[__func__]++;
}
void btif_dm_ssp_reply(const RawAddress bd_addr, bt_ssp_variant_t variant,
                       uint8_t accept) {
  mock_function_count_map[__func__]++;
}
void btif_dm_start_discovery(void) { mock_function_count_map[__func__]++; }
void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr,
                                          BD_NAME bd_name,
                                          tBT_DEVICE_TYPE dev_type) {
  mock_function_count_map[__func__]++;
}
+2 −0
Original line number Diff line number Diff line
@@ -29,3 +29,5 @@ void bluetooth::manager::SetMockBtifStorageInterface(
void btif_storage_load_bonded_eatt(void) {
  btif_storage_interface->LoadBondedEatt();
}

uint8_t btif_storage_get_local_io_caps() { return 0; }
+81 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:9
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#define LOG_TAG "bt_btu_hcif"
#include <base/bind.h>
#include <base/location.h>
#include <cstdint>
#include "btif/include/btif_config.h"
#include "common/metrics.h"
#include "device/include/controller.h"
#include "osi/include/log.h"
#include "stack/btm/btm_int.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/ble_acl_interface.h"
#include "stack/include/ble_hci_link_interface.h"
#include "stack/include/btm_iso_api.h"
#include "stack/include/btu.h"
#include "stack/include/dev_hci_link_interface.h"
#include "stack/include/gatt_api.h"
#include "stack/include/hci_evt_length.h"
#include "stack/include/hcidefs.h"
#include "stack/include/inq_hci_link_interface.h"
#include "stack/include/l2cap_hci_link_interface.h"
#include "stack/include/sco_hci_link_interface.h"
#include "stack/include/sec_hci_link_interface.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

using hci_cmd_cb = base::OnceCallback<void(
    uint8_t* /* return_parameters */, uint16_t /* return_parameters_length*/)>;

struct cmd_with_cb_data {
  hci_cmd_cb cb;
  base::Location posted_from;
};

void btu_hcif_log_event_metrics(uint8_t evt_code, uint8_t* p_event) {
  mock_function_count_map[__func__]++;
}
void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_msg) {
  mock_function_count_map[__func__]++;
}
void btu_hcif_send_cmd(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_buf) {
  mock_function_count_map[__func__]++;
}
void btu_hcif_send_cmd_with_cb(const base::Location& posted_from,
                               uint16_t opcode, uint8_t* params,
                               uint8_t params_len, hci_cmd_cb cb) {
  mock_function_count_map[__func__]++;
}
void cmd_with_cb_data_cleanup(cmd_with_cb_data* cb_wrapper) {
  mock_function_count_map[__func__]++;
}
void cmd_with_cb_data_init(cmd_with_cb_data* cb_wrapper) {
  mock_function_count_map[__func__]++;
}
Loading