1 #pragma once 2 3 #include "internal/sys.hpp" 4 5 #include <unistd.h> 6 7 #include <cstdint> 8 9 #include <gmock/gmock.h> 10 11 namespace internal 12 { 13 14 class InternalSysMock : public Sys 15 { 16 public: 17 virtual ~InternalSysMock() = default; 18 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)); 34 MOCK_METHOD(ssize_t, send, (int, const void*, size_t, int), 35 (const override)); 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)); 44 }; 45 46 } // namespace internal 47