• 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:6
20  *
21  *  mockcify.pl ver 0.3.0
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Mock include file to share data between tests and mock
32 #include "test/mock/mock_osi_allocator.h"
33 
34 // Mocked internal structures, if any
35 
36 namespace test {
37 namespace mock {
38 namespace osi_allocator {
39 
40 // Function state capture and return values, if needed
41 struct osi_calloc osi_calloc;
42 struct osi_free osi_free;
43 struct osi_free_and_reset osi_free_and_reset;
44 struct osi_malloc osi_malloc;
45 struct osi_strdup osi_strdup;
46 struct osi_strndup osi_strndup;
47 
48 }  // namespace osi_allocator
49 }  // namespace mock
50 }  // namespace test
51 
52 // Mocked functions, if any
osi_calloc(size_t size)53 void* osi_calloc(size_t size) {
54   mock_function_count_map[__func__]++;
55   return test::mock::osi_allocator::osi_calloc(size);
56 }
osi_free(void * ptr)57 void osi_free(void* ptr) {
58   mock_function_count_map[__func__]++;
59   test::mock::osi_allocator::osi_free(ptr);
60 }
osi_free_and_reset(void ** p_ptr)61 void osi_free_and_reset(void** p_ptr) {
62   mock_function_count_map[__func__]++;
63   test::mock::osi_allocator::osi_free_and_reset(p_ptr);
64 }
osi_malloc(size_t size)65 void* osi_malloc(size_t size) {
66   mock_function_count_map[__func__]++;
67   return test::mock::osi_allocator::osi_malloc(size);
68 }
osi_strdup(const char * str)69 char* osi_strdup(const char* str) {
70   mock_function_count_map[__func__]++;
71   return test::mock::osi_allocator::osi_strdup(str);
72 }
osi_strndup(const char * str,size_t len)73 char* osi_strndup(const char* str, size_t len) {
74   mock_function_count_map[__func__]++;
75   return test::mock::osi_allocator::osi_strndup(str, len);
76 }
77 // Mocked functions complete
78 // END mockcify generation
79