2
* Compiz configuration system library
4
* Copyright (C) 2012 Canonical Ltd.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
* Sam Spilsbury <sam.spilsbury@canonical.com>
23
#ifndef _COMPIZCONFIG_CCS_INTEGRATED_SETTING_FACTORY_MOCK_H
24
#define _COMPIZCONFIG_CCS_INTEGRATED_SETTING_FACTORY_MOCK_H
26
#include <gtest/gtest.h>
27
#include <gmock/gmock.h>
30
#include <ccs-backend.h>
32
CCSIntegratedSettingFactory *
33
ccsMockIntegratedSettingFactoryNew (CCSObjectAllocationInterface *ai);
36
ccsMockIntegratedSettingFactoryFree (CCSIntegratedSettingFactory *);
38
class CCSIntegratedSettingFactoryGMockInterface
42
virtual ~CCSIntegratedSettingFactoryGMockInterface () {}
44
virtual CCSIntegratedSetting * createIntegratedSettingForCCSNameAndType (CCSIntegration *integration,
45
const char *pluginName,
46
const char *settingName,
47
CCSSettingType type) = 0;
50
class CCSIntegratedSettingFactoryGMock :
51
public CCSIntegratedSettingFactoryGMockInterface
55
MOCK_METHOD4 (createIntegratedSettingForCCSNameAndType, CCSIntegratedSetting * (CCSIntegration *,
60
CCSIntegratedSettingFactoryGMock (CCSIntegratedSettingFactory *integratedSettingFactory) :
61
mIntegratedSettingFactory (integratedSettingFactory)
65
CCSIntegratedSettingFactory *
66
getIntegratedSettingFactory ()
68
return mIntegratedSettingFactory;
73
static CCSIntegratedSetting *
74
ccsIntegratedSettingFactoryCreateIntegratedSettingForCCSSettingNameAndType (CCSIntegratedSettingFactory *factory,
75
CCSIntegration *integration,
76
const char *pluginName,
77
const char *settingName,
80
return reinterpret_cast <CCSIntegratedSettingFactoryGMockInterface *> (factory)->createIntegratedSettingForCCSNameAndType (integration,
87
ccsIntegratedSettingFactoryFree (CCSIntegratedSettingFactory *integratedSettingFactory)
89
ccsMockIntegratedSettingFactoryFree (integratedSettingFactory);
94
CCSIntegratedSettingFactory *mIntegratedSettingFactory;
97
extern const CCSIntegratedSettingFactoryInterface mockIntegratedSettingFactoryInterface;