1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Generated mock file from original source file
19  *   Functions generated:5
20  *
21  *  mockcify.pl ver 0.2
22  */
23 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_stack_metrics_logging.h"
25 
26 #include <string>
27 
28 // Original included files, if any
29 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
30 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
31 
32 #include "test/common/mock_functions.h"
33 #include "types/raw_address.h"
34 
35 // Mocked compile conditionals, if any
36 // Mocked internal structures, if any
37 
38 namespace test {
39 namespace mock {
40 namespace stack_metrics_logging {
41 
42 // Function state capture and return values, if needed
43 struct log_classic_pairing_event log_classic_pairing_event;
44 struct log_link_layer_connection_event log_link_layer_connection_event;
45 struct log_smp_pairing_event log_smp_pairing_event;
46 struct log_sdp_attribute log_sdp_attribute;
47 struct log_manufacturer_info log_manufacturer_info;
48 struct log_counter_metrics log_counter_metrics;
49 struct log_hfp_audio_packet_loss_stats log_hfp_audio_packet_loss_stats;
50 struct log_mmc_transcode_rtt_stats log_mmc_transcode_rtt_stats;
51 
52 }  // namespace stack_metrics_logging
53 }  // namespace mock
54 }  // namespace test
55 
56 // Mocked functions, if any
log_classic_pairing_event(const RawAddress & address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)57 void log_classic_pairing_event(const RawAddress& address, uint16_t handle,
58                                uint32_t hci_cmd, uint16_t hci_event,
59                                uint16_t cmd_status, uint16_t reason_code,
60                                int64_t event_value) {
61   inc_func_call_count(__func__);
62   test::mock::stack_metrics_logging::log_classic_pairing_event(
63       address, handle, hci_cmd, hci_event, cmd_status, reason_code,
64       event_value);
65 }
log_link_layer_connection_event(const RawAddress * address,uint32_t connection_handle,android::bluetooth::DirectionEnum direction,uint16_t link_type,uint32_t hci_cmd,uint16_t hci_event,uint16_t hci_ble_event,uint16_t cmd_status,uint16_t reason_code)66 void log_link_layer_connection_event(
67     const RawAddress* address, uint32_t connection_handle,
68     android::bluetooth::DirectionEnum direction, uint16_t link_type,
69     uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
70     uint16_t cmd_status, uint16_t reason_code) {
71   inc_func_call_count(__func__);
72   test::mock::stack_metrics_logging::log_link_layer_connection_event(
73       address, connection_handle, direction, link_type, hci_cmd, hci_event,
74       hci_ble_event, cmd_status, reason_code);
75 }
log_smp_pairing_event(const RawAddress & address,uint16_t smp_cmd,android::bluetooth::DirectionEnum direction,uint16_t smp_fail_reason)76 void log_smp_pairing_event(const RawAddress& address, uint16_t smp_cmd,
77                            android::bluetooth::DirectionEnum direction,
78                            uint16_t smp_fail_reason) {
79   inc_func_call_count(__func__);
80   test::mock::stack_metrics_logging::log_smp_pairing_event(
81       address, smp_cmd, direction, smp_fail_reason);
82 }
log_sdp_attribute(const RawAddress & address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)83 void log_sdp_attribute(const RawAddress& address, uint16_t protocol_uuid,
84                        uint16_t attribute_id, size_t attribute_size,
85                        const char* attribute_value) {
86   inc_func_call_count(__func__);
87   test::mock::stack_metrics_logging::log_sdp_attribute(
88       address, protocol_uuid, attribute_id, attribute_size, attribute_value);
89 }
log_manufacturer_info(const RawAddress & address,android::bluetooth::DeviceInfoSrcEnum source_type,const std::string & source_name,const std::string & manufacturer,const std::string & model,const std::string & hardware_version,const std::string & software_version)90 void log_manufacturer_info(const RawAddress& address,
91                            android::bluetooth::DeviceInfoSrcEnum source_type,
92                            const std::string& source_name,
93                            const std::string& manufacturer,
94                            const std::string& model,
95                            const std::string& hardware_version,
96                            const std::string& software_version) {
97   inc_func_call_count(__func__);
98   test::mock::stack_metrics_logging::log_manufacturer_info(
99       address, source_type, source_name, manufacturer, model, hardware_version,
100       software_version);
101 }
log_manufacturer_info(const RawAddress & address,android::bluetooth::AddressTypeEnum address_type,android::bluetooth::DeviceInfoSrcEnum source_type,const std::string & source_name,const std::string & manufacturer,const std::string & model,const std::string & hardware_version,const std::string & software_version)102 void log_manufacturer_info(const RawAddress& address,
103                            android::bluetooth::AddressTypeEnum address_type,
104                            android::bluetooth::DeviceInfoSrcEnum source_type,
105                            const std::string& source_name,
106                            const std::string& manufacturer,
107                            const std::string& model,
108                            const std::string& hardware_version,
109                            const std::string& software_version) {
110   inc_func_call_count(__func__);
111   test::mock::stack_metrics_logging::log_manufacturer_info(
112       address, address_type, source_type, source_name, manufacturer, model,
113       hardware_version, software_version);
114 }
115 
log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum key,int64_t value)116 void log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum key,
117                          int64_t value) {
118   inc_func_call_count(__func__);
119   test::mock::stack_metrics_logging::log_counter_metrics(key, value);
120 }
121 
log_hfp_audio_packet_loss_stats(const RawAddress & address,int num_decoded_frames,double packet_loss_ratio,uint16_t codec_type)122 void log_hfp_audio_packet_loss_stats(const RawAddress& address,
123                                      int num_decoded_frames,
124                                      double packet_loss_ratio,
125                                      uint16_t codec_type) {
126   inc_func_call_count(__func__);
127   test::mock::stack_metrics_logging::log_hfp_audio_packet_loss_stats(
128       address, num_decoded_frames, packet_loss_ratio, codec_type);
129 }
130 
log_mmc_transcode_rtt_stats(int maximum_rtt,double mean_rtt,int num_requests,int codec_type)131 void log_mmc_transcode_rtt_stats(int maximum_rtt, double mean_rtt,
132                                  int num_requests, int codec_type) {
133   inc_func_call_count(__func__);
134   test::mock::stack_metrics_logging::log_mmc_transcode_rtt_stats(
135       maximum_rtt, mean_rtt, num_requests, codec_type);
136 }
137 // END mockcify generation
138