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

Commit 0442f396 authored by Chris Manton's avatar Chris Manton
Browse files

net_test_stack_rfcomm: Use system test mocks when possible

Bug: 330654176
Test: m .
Flag: EXEMPT, Test Infrastructure

Change-Id: Ia62d10b417378784f312f4a18d5764fbf9391457
parent b0bdaa0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -807,6 +807,7 @@ cc_test {
        ":TestMockHci",
        ":TestMockMainShim",
        ":TestMockMainShimEntry",
        ":TestMockStackBtm",
        ":TestMockStackMetrics",
        "rfcomm/port_api.cc",
        "rfcomm/port_rfc.cc",
@@ -818,7 +819,6 @@ cc_test {
        "rfcomm/rfc_ts_frames.cc",
        "rfcomm/rfc_utils.cc",
        "test/common/mock_btm_layer.cc",
        "test/common/mock_btu_layer.cc",
        "test/common/mock_l2cap_layer.cc",
        "test/common/stack_test_packet_utils.cc",
        "test/rfcomm/stack_rfcomm_test.cc",
+0 −24
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@

#include "mock_btm_layer.h"

#include "stack/include/bt_psm_types.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/rfcdefs.h"
#include "types/raw_address.h"
@@ -31,25 +30,6 @@ void bluetooth::manager::SetMockSecurityInternalInterface(
  btm_security_internal_interface = mock_btm_security_internal_interface;
}

void btm_sec_abort_access_req(const RawAddress& bd_addr) {
  btm_security_internal_interface->AbortAccessRequest(bd_addr);
}

tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr,
                                      bool is_originator, uint16_t requirement,
                                      tBTM_SEC_CALLBACK* p_callback,
                                      void* p_ref_data) {
  return btm_security_internal_interface->MultiplexingProtocolAccessRequest(
      bd_addr, BT_PSM_RFCOMM, is_originator, BTM_SEC_PROTO_RFCOMM, 0,
      p_callback, p_ref_data);
}

bool BTM_SetSecurityLevel(bool is_originator, const char* p_name,
                          uint8_t service_id, uint16_t sec_level, uint16_t psm,
                          uint32_t mx_proto_id, uint32_t mx_chan_id) {
  return true;
}

uint16_t BTM_GetMaxPacketSize(const RawAddress& addr) {
  return RFCOMM_DEFAULT_MTU;
}
@@ -66,7 +46,3 @@ struct btm_client_interface_t btm_client_interface = {
            .BTM_GetMaxPacketSize = BTM_GetMaxPacketSize,
        },
};

struct btm_client_interface_t& get_btm_client_interface() {
  return btm_client_interface;
}
+0 −2
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@
#include <bluetooth/log.h>
#include <gtest/gtest.h>

#include <string>

using namespace bluetooth;

int main(int argc, char** argv) {