ReadBufferMock.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
  3. *
  4. * This file is part of Embedded Proto.
  5. *
  6. * Embedded Proto is open source software: you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as published
  8. * by the Free Software Foundation, version 3 of the license.
  9. *
  10. * Embedded Proto is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. * For commercial and closed source application please visit:
  19. * <https://EmbeddedProto.com/license/>.
  20. *
  21. * Embedded AMS B.V.
  22. * Info:
  23. * info at EmbeddedProto dot com
  24. *
  25. * Postal address:
  26. * Johan Huizingalaan 763a
  27. * 1066 VH, Amsterdam
  28. * the Netherlands
  29. */
  30. #ifndef _READ_BUFFER_MOCK_H_
  31. #define _READ_BUFFER_MOCK_H_
  32. #include <gmock/gmock.h>
  33. #include <ReadBufferInterface.h>
  34. namespace Mocks
  35. {
  36. class ReadBufferMock : public EmbeddedProto::ReadBufferInterface
  37. {
  38. public:
  39. MOCK_CONST_METHOD0(get_size, uint32_t());
  40. MOCK_CONST_METHOD0(get_max_size, uint32_t());
  41. MOCK_CONST_METHOD1(peek, bool(uint8_t&));
  42. MOCK_METHOD0(advance, void());
  43. MOCK_METHOD1(advance, void(uint32_t));
  44. MOCK_METHOD1(pop, bool(uint8_t&));
  45. MOCK_METHOD0(pop, uint8_t());
  46. };
  47. } // End of namespace Mocks
  48. #endif // End of _READ_BUFFER_MOCK_H_