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

Commit 9fd908da authored by cmanton@google.com's avatar cmanton@google.com Committed by Automerger Merge Worker
Browse files

mock: Split out mock_jni_thread from btif am: 182468aa

parents 25dca882 182468aa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ cc_test {
        ":TestMockBta",
        ":TestMockBtif",
        ":TestMockBtu",
        ":TestMockJni",
        ":TestMockLegacyHciCommands",
        ":TestMockLegacyHciInterface",
        ":TestMockMainShimEntry",
+1 −0
Original line number Diff line number Diff line
@@ -1913,6 +1913,7 @@ cc_test {
        ":TestMockBta",
        ":TestMockBtif",
        ":TestMockHci",
        ":TestMockJni",
        ":TestMockLegacyHciCommands",
        ":TestMockMainShim",
        ":TestMockStackAcl",
+7 −0
Original line number Diff line number Diff line
@@ -338,6 +338,13 @@ filegroup {
    ],
}

filegroup {
    name: "TestMockJni",
    srcs: [
        "mock/mock_jni*.cc",
    ],
}

filegroup {
    name: "TestMockStackHid",
    srcs: [
+1 −23
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@
#include "bta/include/bta_api.h"
#include "btif/include/btif_common.h"
#include "include/hardware/bluetooth.h"
#include "test/common/jni_thread.h"
#include "test/common/mock_functions.h"
#include "types/raw_address.h"

@@ -34,11 +33,7 @@ bool btif_is_dut_mode() {
  inc_func_call_count(__func__);
  return false;
}
bool is_on_jni_thread() {
  inc_func_call_count(__func__);
  return false;
}
bt_property_t* property_deep_copy(const bt_property_t* prop) {
bt_property_t* property_deep_copy(const bt_property_t* /* prop */) {
  inc_func_call_count(__func__);
  return nullptr;
}
@@ -54,23 +49,6 @@ bt_status_t btif_set_dynamic_audio_buffer_size(int codec, int size) {
  inc_func_call_count(__func__);
  return BT_STATUS_SUCCESS;
}
bt_status_t btif_transfer_context(tBTIF_CBACK* p_cback, uint16_t event,
                                  char* p_params, int param_len,
                                  tBTIF_COPY_CBACK* p_copy_cback) {
  inc_func_call_count(__func__);
  return BT_STATUS_SUCCESS;
}
bt_status_t do_in_jni_thread(base::OnceClosure task) {
  inc_func_call_count(__func__);
  do_in_jni_thread_task_queue.push(std::move(task));
  return BT_STATUS_SUCCESS;
}
bt_status_t do_in_jni_thread(const base::Location& from_here,
                             base::OnceClosure task) {
  inc_func_call_count(__func__);
  do_in_jni_thread_task_queue.push(std::move(task));
  return BT_STATUS_SUCCESS;
}
int btif_is_enabled(void) {
  inc_func_call_count(__func__);
  return 0;
+52 −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:27
 */

#include <base/functional/bind.h>

#include <cstdint>

#include "btif/include/btif_common.h"
#include "include/hardware/bluetooth.h"
#include "test/common/jni_thread.h"
#include "test/common/mock_functions.h"

bool is_on_jni_thread() {
  inc_func_call_count(__func__);
  return false;
}
bt_status_t btif_transfer_context(tBTIF_CBACK* /* p_cback */,
                                  uint16_t /* event */, char* /* p_params */,
                                  int /* param_len */,
                                  tBTIF_COPY_CBACK* /* p_copy_cback */) {
  inc_func_call_count(__func__);
  return BT_STATUS_SUCCESS;
}
bt_status_t do_in_jni_thread(base::OnceClosure task) {
  inc_func_call_count(__func__);
  do_in_jni_thread_task_queue.push(std::move(task));
  return BT_STATUS_SUCCESS;
}
bt_status_t do_in_jni_thread(const base::Location& /* from_here */,
                             base::OnceClosure task) {
  inc_func_call_count(__func__);
  do_in_jni_thread_task_queue.push(std::move(task));
  return BT_STATUS_SUCCESS;
}