Skip to content
Snippets Groups Projects
Commit af7eedfb authored by Chris Manton's avatar Chris Manton
Browse files

mockcify: Update legacy mocks

Bug: 188077107
Tag: #refactor
Test: gd/cert/run

Change-Id: If07f823719c4d41ae6fa3106e21edbfd7b353125
parent f073d57f
No related branches found
No related tags found
No related merge requests found
......@@ -346,6 +346,7 @@ cc_test {
srcs: [
":LibBluetoothSources",
":TestCommonMainHandler",
":TestCommonMockFunctions",
":TestMockAndroidHardware",
":BtaDmSources",
":TestMockBtaAg",
......
......@@ -18,11 +18,18 @@
#include <future>
#include <map>
#include "bta/include/bta_ag_api.h"
#include "btif/include/btif_api.h"
#include "btif/include/btif_common.h"
void set_hal_cbacks(bt_callbacks_t* callbacks);
uint8_t appl_trace_level = BT_TRACE_LEVEL_DEBUG;
uint8_t btif_trace_level = BT_TRACE_LEVEL_DEBUG;
uint8_t btu_trace_level = BT_TRACE_LEVEL_DEBUG;
const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};
namespace {
auto timeout_time = std::chrono::seconds(3);
......
......@@ -21,32 +21,18 @@
#include <base/bind.h>
#include <base/callback.h>
#include <base/location.h>
#include "stack_manager.h"
#include "types/raw_address.h"
#include "bta/include/bta_ag_api.h" // tBTA_AG_RES_DATA::kEmpty
#include "hci/include/hci_layer.h" // hci_t
#include "osi/include/log.h"
#include "stack_manager.h"
#include "test/common/mock_functions.h"
#include "test/mock/mock_hci_layer.h"
std::map<std::string, int> mock_function_count_map;
#include "types/raw_address.h"
void set_hal_cbacks(bt_callbacks_t* callbacks); // btif/src/bluetooth.cc
// tLEGACY_TRACE_LEVEL
uint8_t btu_trace_level = 6;
uint8_t appl_trace_level = 6;
uint8_t btif_trace_level = 6;
namespace {
void dump_mock_function_count_map() {
LOG_INFO("Mock function count map size:%zu", mock_function_count_map.size());
for (auto it : mock_function_count_map) {
LOG_INFO("function:%s: call_count:%d", it.first.c_str(), it.second);
}
}
namespace _adapter_state_changed {
bt_state_t state{BT_STATE_OFF};
}
......@@ -168,8 +154,6 @@ hci_t mock_hci = {
.transmit_downward = transmit_downward,
};
const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};
namespace bluetooth {
namespace common {
......
/*
* Copyright 2021 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:3
*
* mockcify.pl ver 0.3.0
*/
#include <cstdint>
#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
// Mock include file to share data between tests and mock
#include "test/mock/mock_main_shim_hci_layer.h"
// Mocked internal structures, if any
const hci_t* bluetooth::shim::hci_layer_get_interface() { return nullptr; }
// bool hci_is_root_inflammation_event_received() { return false; }
/*
* Copyright 2021 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.
*/
#pragma once
/*
* Generated mock file from original source file
* Functions generated:3
*
* mockcify.pl ver 0.3.0
*/
#include <cstdint>
#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
// include files may not be required. The include-what-you-use
// still applies, but crafting proper inclusion is out of scope
// for this effort. This compilation unit may compile as-is, or
// may need attention to prune from (or add to ) the inclusion set.
#include "main/shim/hci_layer.h"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment