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