b22654633583257ab89478efa4766b73de2c5173
[ric-plt/sdl.git] / include / private / tst / systemmock.hpp
1 /*
2    Copyright (c) 2018-2019 Nokia.
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 #ifndef SHAREDDATALAYER_TST_SYSTEMMOCK_HPP_
18 #define SHAREDDATALAYER_TST_SYSTEMMOCK_HPP_
19
20 #include <gmock/gmock.h>
21 #include "private/system.hpp"
22
23 namespace shareddatalayer
24 {
25     namespace tst
26     {
27         class SystemMock: public System
28         {
29         public:
30             MOCK_METHOD3(poll, int(struct pollfd *fds, nfds_t nfds, int timeout));
31
32             MOCK_METHOD1(epoll_create1, int(int flags));
33
34             MOCK_METHOD4(epoll_ctl, void(int epfd, int op, int fd, epoll_event* event));
35
36             MOCK_METHOD4(epoll_wait, int(int epfd, epoll_event* events, int maxevents, int timeout));
37
38             MOCK_METHOD2(timerfd_create, int(int clockid, int flags));
39
40             MOCK_METHOD4(timerfd_settime, void(int fd, int flags, const itimerspec* new_value, itimerspec* old_value));
41
42             MOCK_METHOD3(read, ssize_t(int fd, void* buf, size_t count));
43
44             MOCK_METHOD2(eventfd, int(unsigned int initval, int flags));
45
46             MOCK_METHOD3(write, ssize_t(int fd, const void* buf, size_t count));
47
48             MOCK_METHOD0(time_since_epoch, std::chrono::steady_clock::duration());
49
50             MOCK_METHOD1(close, void(int fd));
51
52             MOCK_METHOD1(getenv, const char*(const char*));
53         };
54     }
55 }
56
57 #endif