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

Commit 86de377a authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "Fix flakiness in net_test_btif_hh" into main

parents 02d183c3 d85d34e2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -578,7 +578,6 @@ cc_test {
        ":TestCommonCoreInterface",
        ":TestCommonMainHandler",
        ":TestCommonMockFunctions",
        ":TestFakeOsi",
        ":TestMockAndroidHardware",
        ":TestMockBtaAg",
        ":TestMockBtaAr",
@@ -601,7 +600,6 @@ cc_test {
        ":TestMockBtaVc",
        ":TestMockBtcore",
        ":TestMockBtu",
        ":TestMockCommon",
        ":TestMockFrameworks",
        ":TestMockHci",
        ":TestMockMainShim",
@@ -636,6 +634,7 @@ cc_test {
        "libbluetooth_crypto_toolbox",
        "libbluetooth_gd",
        "libbt-audio-hal-interface",
        "libbt-common",
        "libbt-platform-protos-lite",
        "libbt-sbc-decoder",
        "libbt-sbc-encoder",
@@ -651,6 +650,8 @@ cc_test {
        "libcom.android.sysprop.bluetooth.wrapped",
        "libevent",
        "libgmock",
        "libosi",
        "libprotobuf-cpp-lite",
        "libstatslog_bt",
    ],
    cflags: [
+2 −20
Original line number Diff line number Diff line
@@ -153,27 +153,9 @@ bthh_callbacks_t bthh_callbacks = {

class BtifHhWithMockTest : public ::testing::Test {
 protected:
  void SetUp() override {
    reset_mock_function_count_map();
    test::mock::osi_allocator::osi_malloc.body = [](size_t size) {
      return malloc(size);
    };
    test::mock::osi_allocator::osi_calloc.body = [](size_t size) {
      return calloc(1UL, size);
    };
    test::mock::osi_allocator::osi_free.body = [](void* ptr) { free(ptr); };
    test::mock::osi_allocator::osi_free_and_reset.body = [](void** ptr) {
      free(*ptr);
      *ptr = nullptr;
    };
  }
  void SetUp() override { reset_mock_function_count_map(); }

  void TearDown() override {
    test::mock::osi_allocator::osi_malloc = {};
    test::mock::osi_allocator::osi_calloc = {};
    test::mock::osi_allocator::osi_free = {};
    test::mock::osi_allocator::osi_free_and_reset = {};
  }
  void TearDown() override {}
};

class BtifHhWithHalCallbacksTest : public BtifHhWithMockTest {