Loading system/btif/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,7 @@ cc_test { srcs: [ ":LibBluetoothSources", ":TestCommonMainHandler", ":TestCommonMockFunctions", ":TestMockAndroidHardware", ":BtaDmSources", ":TestMockBtaAg", Loading system/btif/test/btif_core_test.cc +7 −0 Original line number Diff line number Diff line Loading @@ -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); Loading system/btif/test/btif_stack_test.cc +4 −20 Original line number Diff line number Diff line Loading @@ -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}; } Loading Loading @@ -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 { Loading system/test/mock/mock_main_shim_hci_layer.cc 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * 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; } system/test/mock/mock_main_shim_hci_layer.h 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * 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" Loading
system/btif/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,7 @@ cc_test { srcs: [ ":LibBluetoothSources", ":TestCommonMainHandler", ":TestCommonMockFunctions", ":TestMockAndroidHardware", ":BtaDmSources", ":TestMockBtaAg", Loading
system/btif/test/btif_core_test.cc +7 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
system/btif/test/btif_stack_test.cc +4 −20 Original line number Diff line number Diff line Loading @@ -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}; } Loading Loading @@ -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 { Loading
system/test/mock/mock_main_shim_hci_layer.cc 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * 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; }
system/test/mock/mock_main_shim_hci_layer.h 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * 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"