blob: ce37d912e8197e2f8a2c3ca1b6ac995ca750b4ac [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
19 MOCK_CONST_METHOD2(open, int(const char*, int));
Patrick Venturecec04902019-01-15 13:04:44 -080020 MOCK_CONST_METHOD3(read, int(int, void*, std::size_t));
Brandon Kim493b3af2019-11-05 16:28:40 -080021 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 Venture8b588562018-11-18 08:44:33 -080023 MOCK_CONST_METHOD1(close, int(int));
Patrick Venture28abae72018-12-14 09:44:02 -080024 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 Venture8b588562018-11-18 08:44:33 -080026 MOCK_CONST_METHOD0(getpagesize, int());
Patrick Venture7b91cbc2018-11-28 14:24:41 -080027 MOCK_CONST_METHOD3(ioctl, int(int, unsigned long, void*));
Patrick Venture7b78aa22018-12-14 13:56:15 -080028 MOCK_CONST_METHOD3(poll, int(struct pollfd*, nfds_t, int));
Patrick Venturecf9b2192019-06-27 12:09:52 -070029 MOCK_CONST_METHOD1(getSize, std::int64_t(const char*));
Patrick Venture8b588562018-11-18 08:44:33 -080030};
31
32} // namespace internal