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 | |
Willy Tu | f450486 | 2021-04-24 23:22:19 -0700 | [diff] [blame] | 19 | MOCK_METHOD(int, open, (const char*, int), (const override)); |
| 20 | MOCK_METHOD(int, read, (int, void*, std::size_t), (const override)); |
| 21 | MOCK_METHOD(int, pread, (int, void*, std::size_t, off_t), (const override)); |
| 22 | MOCK_METHOD(int, pwrite, (int, const void*, std::size_t, off_t), |
| 23 | (const override)); |
| 24 | MOCK_METHOD(int, close, (int), (const override)); |
| 25 | MOCK_METHOD(void*, mmap, (void*, std::size_t, int, int, int, off_t), |
| 26 | (const override)); |
| 27 | MOCK_METHOD(int, munmap, (void*, std::size_t), (const override)); |
| 28 | MOCK_METHOD(int, getpagesize, (), (const override)); |
| 29 | MOCK_METHOD(int, ioctl, (int, unsigned long, void*), (const override)); |
| 30 | MOCK_METHOD(int, poll, (struct pollfd*, nfds_t, int), (const override)); |
| 31 | MOCK_METHOD(int, socket, (int, int, int), (const override)); |
| 32 | MOCK_METHOD(int, connect, (int, const struct sockaddr*, socklen_t), |
| 33 | (const override)); |
William A. Kennington III | 9bb21e3 | 2022-04-08 14:28:50 -0700 | [diff] [blame] | 34 | MOCK_METHOD(ssize_t, send, (int, const void*, size_t, int), |
| 35 | (const override)); |
Willy Tu | f450486 | 2021-04-24 23:22:19 -0700 | [diff] [blame] | 36 | MOCK_METHOD(ssize_t, sendfile, (int, int, off_t*, size_t), |
| 37 | (const override)); |
| 38 | MOCK_METHOD(int, getaddrinfo, |
| 39 | (const char*, const char*, const struct addrinfo*, |
| 40 | struct addrinfo**), |
| 41 | (const override)); |
| 42 | MOCK_METHOD(void, freeaddrinfo, (struct addrinfo*), (const override)); |
| 43 | MOCK_METHOD(std::int64_t, getSize, (const char*), (const override)); |
Patrick Venture | 8b58856 | 2018-11-18 08:44:33 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | } // namespace internal |