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