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:11
20  */
21 
22 #include <map>
23 #include <string>
24 
25 extern std::map<std::string, int> mock_function_count_map;
26 
27 #include <fmq/EventFlag.h>
28 
29 using namespace android;
30 using namespace android::hardware;
31 
32 namespace android {
33 namespace hardware {
34 namespace details {
35 
logError(const std::string & message)36 void logError(const std::string& message) {}
37 
38 }  // namespace details
39 }  // namespace hardware
40 }  // namespace android
41 
42 #if 0
43 #include <linux/futex.h>
44 #include <string.h>
45 #include <sys/mman.h>
46 #include <sys/syscall.h>
47 #include <unistd.h>
48 #include <utils/Log.h>
49 #include <utils/SystemClock.h>
50 #include <new>
51 #endif
52 
53 #ifndef UNUSED_ATTR
54 #define UNUSED_ATTR
55 #endif
56 
EventFlag(int fd,off_t offset,status_t * status)57 EventFlag::EventFlag(int fd, off_t offset, status_t* status) {
58   mock_function_count_map[__func__]++;
59 }
EventFlag(std::atomic<uint32_t> * fwAddr,status_t * status)60 EventFlag::EventFlag(std::atomic<uint32_t>* fwAddr, status_t* status) {
61   mock_function_count_map[__func__]++;
62 }
~EventFlag()63 EventFlag::~EventFlag() { mock_function_count_map[__func__]++; }
createEventFlag(int fd,off_t offset,EventFlag ** flag)64 status_t EventFlag::createEventFlag(int fd, off_t offset, EventFlag** flag) {
65   mock_function_count_map[__func__]++;
66   return 0;
67 }
createEventFlag(std::atomic<uint32_t> * fwAddr,EventFlag ** flag)68 status_t EventFlag::createEventFlag(std::atomic<uint32_t>* fwAddr,
69                                     EventFlag** flag) {
70   mock_function_count_map[__func__]++;
71   return 0;
72 }
deleteEventFlag(EventFlag ** evFlag)73 status_t EventFlag::deleteEventFlag(EventFlag** evFlag) {
74   mock_function_count_map[__func__]++;
75   return 0;
76 }
unmapEventFlagWord(std::atomic<uint32_t> * efWordPtr,bool * efWordNeedsUnmapping)77 status_t EventFlag::unmapEventFlagWord(std::atomic<uint32_t>* efWordPtr,
78                                        bool* efWordNeedsUnmapping) {
79   mock_function_count_map[__func__]++;
80   return 0;
81 }
wait(uint32_t bitmask,uint32_t * efState,int64_t timeoutNanoSeconds,bool retry)82 status_t EventFlag::wait(uint32_t bitmask, uint32_t* efState,
83                          int64_t timeoutNanoSeconds, bool retry) {
84   mock_function_count_map[__func__]++;
85   return 0;
86 }
waitHelper(uint32_t bitmask,uint32_t * efState,int64_t timeoutNanoSeconds)87 status_t EventFlag::waitHelper(uint32_t bitmask, uint32_t* efState,
88                                int64_t timeoutNanoSeconds) {
89   mock_function_count_map[__func__]++;
90   return 0;
91 }
wake(uint32_t bitmask)92 status_t EventFlag::wake(uint32_t bitmask) {
93   mock_function_count_map[__func__]++;
94   return 0;
95 }
addNanosecondsToCurrentTime(int64_t nanoSeconds,struct timespec * waitTime)96 void EventFlag::addNanosecondsToCurrentTime(int64_t nanoSeconds,
97                                             struct timespec* waitTime) {
98   mock_function_count_map[__func__]++;
99 }
100