• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 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 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:6
21  *
22  *  mockcify.pl ver 0.5.0
23  */
24 
25 #include <cstdint>
26 #include <functional>
27 #include <map>
28 #include <string>
29 
30 // Original included files, if any
31 // NOTE: Since this is a mock file with mock definitions some number of
32 //       include files may not be required.  The include-what-you-use
33 //       still applies, but crafting proper inclusion is out of scope
34 //       for this effort.  This compilation unit may compile as-is, or
35 //       may need attention to prune from (or add to ) the inclusion set.
36 #include <string.h>
37 
38 #include "avrc_api.h"
39 #include "stack/avrc/avrc_int.h"
40 #include "test/common/mock_functions.h"
41 
42 // Original usings
43 
44 // Mocked compile conditionals, if any
45 
46 namespace test {
47 namespace mock {
48 namespace stack_avrc_utils {
49 
50 // Shared state between mocked functions and tests
51 // Name: AVRC_IsValidAvcType
52 // Params: uint8_t pdu_id, uint8_t avc_type
53 // Return: bool
54 struct AVRC_IsValidAvcType {
55   static bool return_value;
56   std::function<bool(uint8_t pdu_id, uint8_t avc_type)> body{
57       [](uint8_t pdu_id, uint8_t avc_type) { return return_value; }};
operatorAVRC_IsValidAvcType58   bool operator()(uint8_t pdu_id, uint8_t avc_type) {
59     return body(pdu_id, avc_type);
60   };
61 };
62 extern struct AVRC_IsValidAvcType AVRC_IsValidAvcType;
63 
64 // Name: AVRC_IsValidPlayerAttr
65 // Params: uint8_t attr
66 // Return: bool
67 struct AVRC_IsValidPlayerAttr {
68   static bool return_value;
69   std::function<bool(uint8_t attr)> body{
70       [](uint8_t attr) { return return_value; }};
operatorAVRC_IsValidPlayerAttr71   bool operator()(uint8_t attr) { return body(attr); };
72 };
73 extern struct AVRC_IsValidPlayerAttr AVRC_IsValidPlayerAttr;
74 
75 // Name: avrc_is_valid_opcode
76 // Params: uint8_t opcode
77 // Return: bool
78 struct avrc_is_valid_opcode {
79   static bool return_value;
80   std::function<bool(uint8_t opcode)> body{
81       [](uint8_t opcode) { return return_value; }};
operatoravrc_is_valid_opcode82   bool operator()(uint8_t opcode) { return body(opcode); };
83 };
84 extern struct avrc_is_valid_opcode avrc_is_valid_opcode;
85 
86 // Name: avrc_is_valid_player_attrib_value
87 // Params: uint8_t attrib, uint8_t value
88 // Return: bool
89 struct avrc_is_valid_player_attrib_value {
90   static bool return_value;
91   std::function<bool(uint8_t attrib, uint8_t value)> body{
92       [](uint8_t attrib, uint8_t value) { return return_value; }};
operatoravrc_is_valid_player_attrib_value93   bool operator()(uint8_t attrib, uint8_t value) {
94     return body(attrib, value);
95   };
96 };
97 extern struct avrc_is_valid_player_attrib_value
98     avrc_is_valid_player_attrib_value;
99 
100 // Name: avrc_opcode_from_pdu
101 // Params: uint8_t pdu
102 // Return: uint8_t
103 struct avrc_opcode_from_pdu {
104   static uint8_t return_value;
105   std::function<uint8_t(uint8_t pdu)> body{
106       [](uint8_t pdu) { return return_value; }};
operatoravrc_opcode_from_pdu107   uint8_t operator()(uint8_t pdu) { return body(pdu); };
108 };
109 extern struct avrc_opcode_from_pdu avrc_opcode_from_pdu;
110 
111 // Name: avrc_pars_pass_thru
112 // Params: tAVRC_MSG_PASS* p_msg, uint16_t* p_vendor_unique_id
113 // Return: tAVRC_STS
114 struct avrc_pars_pass_thru {
115   static tAVRC_STS return_value;
116   std::function<tAVRC_STS(tAVRC_MSG_PASS* p_msg, uint16_t* p_vendor_unique_id)>
117       body{[](tAVRC_MSG_PASS* p_msg, uint16_t* p_vendor_unique_id) {
118         return return_value;
119       }};
operatoravrc_pars_pass_thru120   tAVRC_STS operator()(tAVRC_MSG_PASS* p_msg, uint16_t* p_vendor_unique_id) {
121     return body(p_msg, p_vendor_unique_id);
122   };
123 };
124 extern struct avrc_pars_pass_thru avrc_pars_pass_thru;
125 
126 }  // namespace stack_avrc_utils
127 }  // namespace mock
128 }  // namespace test
129 
130 // END mockcify generation
131