blob: c45412d291532ccc7819578d9e7797ad015212b2 [file] [log] [blame]
Patrick Venture8b588562018-11-18 08:44:33 -08001#pragma once
2
3#include "internal/sys.hpp"
4
5#include <unistd.h>
6
Patrick Venturecf9b2192019-06-27 12:09:52 -07007#include <cstdint>
8
Patrick Venture8b588562018-11-18 08:44:33 -08009#include <gmock/gmock.h>
10
Patrick Venture8b588562018-11-18 08:44:33 -080011namespace internal
12{
13
14class InternalSysMock : public Sys
15{
16 public:
17 virtual ~InternalSysMock() = default;
18
Willy Tuf4504862021-04-24 23:22:19 -070019 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 III9bb21e32022-04-08 14:28:50 -070034 MOCK_METHOD(ssize_t, send, (int, const void*, size_t, int),
35 (const override));
Willy Tuf4504862021-04-24 23:22:19 -070036 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 Venture8b588562018-11-18 08:44:33 -080044};
45
46} // namespace internal