~chasedouglas/+junk/client-lib

« back to all changes in this revision

Viewing changes to unit-tests/compositor/mock_buffer_allocation_strategy.h

  • Committer: Kevin DuBois
  • Date: 2012-07-13 15:57:24 UTC
  • mfrom: (67.1.1 rm-double-mock)
  • Revision ID: kevin.dubois@canonical.com-20120713155724-udb8pcnue8x98ttx
merge of lp:~rocket-scientists/mir/rm-double-mock
MockGraphicBufferAllocator was defined in two files. removes one of the files that defines it. (this file's include guard was the same as the other file that defined the mock

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2012 Canonical Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17
 
 */
18
 
 
19
 
#ifndef MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_
20
 
#define MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_
21
 
 
22
 
#include "mir/compositor/graphic_buffer_allocator.h"
23
 
 
24
 
#include <gmock/gmock.h>
25
 
#include <gtest/gtest.h>
26
 
 
27
 
namespace mir
28
 
{
29
 
namespace compositor
30
 
{
31
 
 
32
 
void test() {}
33
 
 
34
 
struct MockGraphicBufferAllocator : mc::GraphicBufferAllocator
35
 
{
36
 
 public:
37
 
    MockGraphicBufferAllocator() 
38
 
    {
39
 
        using namespace testing;
40
 
 
41
 
        std::unique_ptr<Buffer> testbuffer(nullptr);
42
 
 
43
 
        ON_CALL(*this, alloc_buffer(_,_,_))
44
 
                .WillByDefault(ReturnRef(testbuffer));
45
 
 
46
 
    }
47
 
 
48
 
    MOCK_METHOD3(alloc_buffer, std::unique_ptr<Buffer>& (geometry::Width, geometry::Height, PixelFormat));
49
 
    MOCK_METHOD1(free_buffer, void(std::shared_ptr<Buffer>));
50
 
};
51
 
 
52
 
}
53
 
}
54
 
 
55
 
#endif // MIR_COMPOSITOR_MOCK_GRAPHIC_BUFFER_ALLOCATOR_H_