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

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

net_test_btif: Properly call btif_dm_cleanup in tear down am: 6cea879f

parents eb1797ef 6cea879f
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -73,6 +73,7 @@ EventCallbacks mock_event_callbacks = {
           int /* snr */, int /* retransmission_count */,
           int /* snr */, int /* retransmission_count */,
           int /* packets_not_receive_count */,
           int /* packets_not_receive_count */,
           int /* negative_acknowledgement_count */) {},
           int /* negative_acknowledgement_count */) {},
    .invoke_key_missing_cb = [](RawAddress /* bd_addr */) {},
};
};


// This interface lets us query for configuration properties of the stack that
// This interface lets us query for configuration properties of the stack that
+17 −5
Original line number Original line Diff line number Diff line
@@ -68,18 +68,30 @@ constexpr tBTM_BLE_IDLE_TIME_MS idle_time = 0x2468acd0;
constexpr tBTM_BLE_ENERGY_USED energy_used = 0x13579bdf;
constexpr tBTM_BLE_ENERGY_USED energy_used = 0x13579bdf;
}  // namespace
}  // namespace


class BtifDmTest : public ::testing::Test {
class BtifDmWithMocksTest : public ::testing::Test {
 protected:
  void SetUp() override { fake_osi_ = std::make_unique<test::fake::FakeOsi>(); }

  void TearDown() override { fake_osi_.reset(); }

  std::unique_ptr<test::fake::FakeOsi> fake_osi_;
};

class BtifDmTest : public BtifDmWithMocksTest {
 protected:
 protected:
  void SetUp() override {
  void SetUp() override {
    fake_osi_ = std::make_unique<test::fake::FakeOsi>();
    BtifDmWithMocksTest::SetUp();
    mock_core_interface_ = std::make_unique<MockCoreInterface>();
    mock_core_interface_ = std::make_unique<MockCoreInterface>();
    bluetooth::legacy::testing::set_interface_to_profiles(
    bluetooth::legacy::testing::set_interface_to_profiles(
        mock_core_interface_.get());
        mock_core_interface_.get());
  }
  }


  void TearDown() override {}
  void TearDown() override {
    bluetooth::legacy::testing::set_interface_to_profiles(nullptr);
    mock_core_interface_.reset();
    BtifDmWithMocksTest::TearDown();
  }


  std::unique_ptr<test::fake::FakeOsi> fake_osi_;
  std::unique_ptr<MockCoreInterface> mock_core_interface_;
  std::unique_ptr<MockCoreInterface> mock_core_interface_;
};
};


@@ -106,7 +118,7 @@ class BtifDmWithUidTest : public BtifDmTest {
  }
  }


  void TearDown() override {
  void TearDown() override {
    void btif_dm_cleanup();
    btif_dm_cleanup();
    BtifDmTest::TearDown();
    BtifDmTest::TearDown();
  }
  }
};
};