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

Commit 9e80dd18 authored by Chris Manton's avatar Chris Manton
Browse files

test: Should not reset global btm_interface structure

Exported only to modify internal functions for testing.

Bug: 306472089
Test: atest bt_host_test_bta

Change-Id: Id6ae477fcf1916ce34c4e2092693e815e4fd2156
parent aa6231ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include "stack/include/bt_hdr.h"
#include "stack/include/btm_status.h"
#include "test/fake/fake_osi.h"
#include "test/mock/mock_stack_btm.h"
#include "test/mock/mock_stack_btm_interface.h"
#include "types/bluetooth/uuid.h"

using bluetooth::Uuid;
+1 −3
Original line number Diff line number Diff line
@@ -36,12 +36,11 @@
#include "test/mock/mock_osi_alarm.h"
#include "test/mock/mock_osi_allocator.h"
#include "test/mock/mock_stack_acl.h"
#include "test/mock/mock_stack_btm.h"
#include "test/mock/mock_stack_btm_ble.h"
#include "test/mock/mock_stack_btm_interface.h"
#include "types/ble_address_with_type.h"

using namespace std::chrono_literals;
using ::testing::ElementsAre;

namespace base {
class MessageLoop;
@@ -97,7 +96,6 @@ class BtaDmTest : public testing::Test {
    bluetooth::legacy::testing::bta_dm_deinit_cb();
    post_on_bt_main([]() { LOG_INFO("Main thread shutting down"); });
    main_thread_shut_down();
    btm_client_interface = {};
  }

  std::unique_ptr<test::fake::FakeOsi> fake_osi_;
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <stdarg.h>

#include <memory>
#include <string>
@@ -25,7 +24,7 @@
#include "osi/include/allocator.h"
#include "test/common/main_handler.h"
#include "test/fake/fake_osi.h"
#include "test/mock/mock_stack_btm.h"
#include "test/mock/mock_stack_btm_interface.h"
#include "test/mock/mock_stack_gatt_api.h"

void BTA_dm_on_hw_on();
+1 −3
Original line number Diff line number Diff line
@@ -19,11 +19,9 @@
#include <gtest/gtest.h>
#include <sys/socket.h>

#include "bta/dm/bta_dm_int.h"
#include "bta/dm/bta_dm_sec_int.h"
#include "bta/include/bta_api.h"
#include "test/mock/mock_stack_btm.h"
#include "test/mock/mock_stack_btm_inq.h"
#include "test/mock/mock_stack_btm_interface.h"
#include "types/raw_address.h"

using ::testing::ElementsAre;
+3 −3
Original line number Diff line number Diff line
@@ -19,12 +19,12 @@
 */

#include "stack/include/btm_api.h"
#include "stack/include/btm_sec_api.h"
#include "stack/include/btm_ble_sec_api.h"
#include "stack/include/btm_ble_api_types.h"
#include "stack/include/btm_ble_sec_api.h"
#include "stack/include/btm_ble_sec_api_types.h"
#include "stack/include/btm_sec_api_types.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_sec_api.h"
#include "stack/include/btm_sec_api_types.h"
#include "types/raw_address.h"

namespace {
Loading