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_BUFFER_H_
20
#define MIR_COMPOSITOR_MOCK_BUFFER_H_
22
#include "mir/compositor/buffer.h"
23
#include "mir/geometry/dimensions.h"
25
#include <gmock/gmock.h>
26
#include <gtest/gtest.h>
33
namespace geom = mir::geometry;
35
struct MockBuffer : public Buffer
38
MockBuffer(geom::Width w,
43
using namespace testing;
44
ON_CALL(*this, width())
45
.WillByDefault(Return(w));
46
ON_CALL(*this, height())
47
.WillByDefault(Return(h));
48
ON_CALL(*this, stride())
49
.WillByDefault(Return(s));
50
ON_CALL(*this, pixel_format())
51
.WillByDefault(Return(pf));
54
MOCK_CONST_METHOD0(width, geom::Width());
55
MOCK_CONST_METHOD0(height, geom::Height());
56
MOCK_CONST_METHOD0(stride, geom::Stride());
57
MOCK_CONST_METHOD0(pixel_format, PixelFormat());
59
MOCK_METHOD0(lock, void());
60
MOCK_METHOD0(unlock, void());
61
MOCK_METHOD0(bind_to_texture, graphics::Texture*());
68
#endif // MIR_COMPOSITOR_MOCK_BUFFER_H_