• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:4
20  *
21  *  mockcify.pl ver 0.3.0
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune from (or add to ) the inclusion set.
35 #include <cutils/properties.h>
36 #include <string.h>
37 
38 #include "osi/include/properties.h"
39 #include "test/common/mock_functions.h"
40 
41 // Mocked compile conditionals, if any
42 
43 namespace test {
44 namespace mock {
45 namespace osi_properties {
46 
47 // Shared state between mocked functions and tests
48 // Name: osi_property_get
49 // Params: const char* key, char* value, const char* default_value
50 // Return: int
51 struct osi_property_get {
52   int return_value{0};
53   std::function<int(const char* key, char* value, const char* default_value)>
54       body{[this](const char* key, char* value, const char* default_value) {
55         return return_value;
56       }};
operatorosi_property_get57   int operator()(const char* key, char* value, const char* default_value) {
58     return body(key, value, default_value);
59   };
60 };
61 extern struct osi_property_get osi_property_get;
62 
63 // Name: osi_property_get_bool
64 // Params: const char* key, bool default_value
65 // Return: bool
66 struct osi_property_get_bool {
67   bool return_value{false};
68   std::function<bool(const char* key, bool default_value)> body{
69       [this](const char* key, bool default_value) { return return_value; }};
operatorosi_property_get_bool70   bool operator()(const char* key, bool default_value) {
71     return body(key, default_value);
72   };
73 };
74 extern struct osi_property_get_bool osi_property_get_bool;
75 
76 // Name: osi_property_get_int32
77 // Params: const char* key, int32_t default_value
78 // Return: int32_t
79 struct osi_property_get_int32 {
80   int32_t return_value{0};
81   std::function<int32_t(const char* key, int32_t default_value)> body{
82       [this](const char* key, int32_t default_value) { return return_value; }};
operatorosi_property_get_int3283   int32_t operator()(const char* key, int32_t default_value) {
84     return body(key, default_value);
85   };
86 };
87 extern struct osi_property_get_int32 osi_property_get_int32;
88 
89 // Name: osi_property_set
90 // Params: const char* key, const char* value
91 // Return: int
92 struct osi_property_set {
93   int return_value{0};
94   std::function<int(const char* key, const char* value)> body{
95       [this](const char* key, const char* value) { return return_value; }};
operatorosi_property_set96   int operator()(const char* key, const char* value) {
97     return body(key, value);
98   };
99 };
100 extern struct osi_property_set osi_property_set;
101 
102 }  // namespace osi_properties
103 }  // namespace mock
104 }  // namespace test
105 
106 // END mockcify generation