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:8
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_allocation_tracker.h"
31
32 // Mocked internal structures, if any
33
34 namespace test {
35 namespace mock {
36 namespace osi_allocation_tracker {
37
38 // Function state capture and return values, if needed
39 struct allocation_tracker_expect_no_allocations
40 allocation_tracker_expect_no_allocations;
41 struct allocation_tracker_init allocation_tracker_init;
42 struct allocation_tracker_notify_alloc allocation_tracker_notify_alloc;
43 struct allocation_tracker_notify_free allocation_tracker_notify_free;
44 struct allocation_tracker_reset allocation_tracker_reset;
45 struct allocation_tracker_resize_for_canary
46 allocation_tracker_resize_for_canary;
47 struct allocation_tracker_uninit allocation_tracker_uninit;
48 struct osi_allocator_debug_dump osi_allocator_debug_dump;
49
50 } // namespace osi_allocation_tracker
51 } // namespace mock
52 } // namespace test
53
54 // Mocked functions, if any
allocation_tracker_expect_no_allocations(void)55 size_t allocation_tracker_expect_no_allocations(void) {
56 inc_func_call_count(__func__);
57 return test::mock::osi_allocation_tracker::
58 allocation_tracker_expect_no_allocations();
59 }
allocation_tracker_init(void)60 void allocation_tracker_init(void) {
61 inc_func_call_count(__func__);
62 test::mock::osi_allocation_tracker::allocation_tracker_init();
63 }
allocation_tracker_notify_alloc(uint8_t allocator_id,void * ptr,size_t requested_size)64 void* allocation_tracker_notify_alloc(uint8_t allocator_id, void* ptr,
65 size_t requested_size) {
66 inc_func_call_count(__func__);
67 return test::mock::osi_allocation_tracker::allocation_tracker_notify_alloc(
68 allocator_id, ptr, requested_size);
69 }
allocation_tracker_notify_free(uint8_t allocator_id,void * ptr)70 void* allocation_tracker_notify_free(uint8_t allocator_id, void* ptr) {
71 inc_func_call_count(__func__);
72 return test::mock::osi_allocation_tracker::allocation_tracker_notify_free(
73 allocator_id, ptr);
74 }
allocation_tracker_reset(void)75 void allocation_tracker_reset(void) {
76 inc_func_call_count(__func__);
77 test::mock::osi_allocation_tracker::allocation_tracker_reset();
78 }
allocation_tracker_resize_for_canary(size_t size)79 size_t allocation_tracker_resize_for_canary(size_t size) {
80 inc_func_call_count(__func__);
81 return test::mock::osi_allocation_tracker::
82 allocation_tracker_resize_for_canary(size);
83 }
allocation_tracker_uninit(void)84 void allocation_tracker_uninit(void) {
85 inc_func_call_count(__func__);
86 test::mock::osi_allocation_tracker::allocation_tracker_uninit();
87 }
osi_allocator_debug_dump(int fd)88 void osi_allocator_debug_dump(int fd) {
89 inc_func_call_count(__func__);
90 test::mock::osi_allocation_tracker::osi_allocator_debug_dump(fd);
91 }
92 // Mocked functions complete
93 // END mockcify generation
94