Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "internal/sys.hpp" |
| 4 | |
| 5 | #include <unistd.h> |
| 6 | |
Patrick Venture | cf9b219 | 2019-06-27 12:09:52 -0700 | [diff] [blame] | 7 | #include <cstdint> |
| 8 | |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 9 | #include <gmock/gmock.h> |
| 10 | |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 11 | namespace internal |
| 12 | { |
| 13 | |
| 14 | class InternalSysMock : public Sys |
| 15 | { |
| 16 | public: |
| 17 | virtual ~InternalSysMock() = default; |
| 18 | |
| 19 | MOCK_CONST_METHOD2(open, int(const char*, int)); |
Patrick Venture | cec0490 | 2019-01-15 13:04:44 -0800 | [diff] [blame] | 20 | MOCK_CONST_METHOD3(read, int(int, void*, std::size_t)); |
Brandon Kim | 493b3af | 2019-11-05 16:28:40 -0800 | [diff] [blame] | 21 | MOCK_CONST_METHOD4(pread, int(int, void*, std::size_t, off_t)); |
| 22 | MOCK_CONST_METHOD4(pwrite, int(int, const void*, std::size_t, off_t)); |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 23 | MOCK_CONST_METHOD1(close, int(int)); |
Patrick Venture | 28abae7 | 2018-12-14 09:44:02 -0800 | [diff] [blame] | 24 | MOCK_CONST_METHOD6(mmap, void*(void*, std::size_t, int, int, int, off_t)); |
| 25 | MOCK_CONST_METHOD2(munmap, int(void*, std::size_t)); |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 26 | MOCK_CONST_METHOD0(getpagesize, int()); |
Patrick Venture | 7b91cbc | 2018-11-28 14:24:41 -0800 | [diff] [blame] | 27 | MOCK_CONST_METHOD3(ioctl, int(int, unsigned long, void*)); |
Patrick Venture | 7b78aa2 | 2018-12-14 13:56:15 -0800 | [diff] [blame] | 28 | MOCK_CONST_METHOD3(poll, int(struct pollfd*, nfds_t, int)); |
Benjamin Fair | f7ccadb | 2019-10-11 17:55:27 -0700 | [diff] [blame] | 29 | MOCK_CONST_METHOD3(socket, int(int, int, int)); |
| 30 | MOCK_CONST_METHOD3(connect, int(int, const struct sockaddr*, socklen_t)); |
| 31 | MOCK_CONST_METHOD4(sendfile, ssize_t(int, int, off_t*, size_t)); |
| 32 | MOCK_CONST_METHOD4(getaddrinfo, |
| 33 | int(const char*, const char*, const struct addrinfo*, |
| 34 | struct addrinfo**)); |
| 35 | MOCK_CONST_METHOD1(freeaddrinfo, void(struct addrinfo*)); |
Patrick Venture | cf9b219 | 2019-06-27 12:09:52 -0700 | [diff] [blame] | 36 | MOCK_CONST_METHOD1(getSize, std::int64_t(const char*)); |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | } // namespace internal |