2
* Copyright © 2012 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Thomas Voss <thomas.voss@canonical.com>
19
#ifndef MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_
20
#define MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_
22
#include "mir/compositor/graphic_buffer_allocator.h"
24
#include <gmock/gmock.h>
25
#include <gtest/gtest.h>
34
struct MockGraphicBufferAllocator : mc::GraphicBufferAllocator
37
MockGraphicBufferAllocator()
39
using namespace testing;
41
std::unique_ptr<Buffer> testbuffer(nullptr);
43
ON_CALL(*this, alloc_buffer(_,_,_))
44
.WillByDefault(ReturnRef(testbuffer));
48
MOCK_METHOD3(alloc_buffer, std::unique_ptr<Buffer>& (geometry::Width, geometry::Height, PixelFormat));
49
MOCK_METHOD1(free_buffer, void(std::shared_ptr<Buffer>));
55
#endif // MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_