KiCad PCB EDA Suite
mock_kiface_base.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
26#include <kiface_base.h>
27#include <config.h>
28
29// Suppress a warning that the mock methods don't override the base class methods because
30// turtlemocks doesn't seem to provide a way to actually annotate the methods with override.
31#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
32 _Pragma( "GCC diagnostic push" ) \
33 _Pragma( "GCC diagnostic ignored \"-Winconsistent-missing-override\"" )
34#endif
35
36MOCK_BASE_CLASS( MOCK_KIFACE_BASE, KIFACE_BASE )
37{
38 MOCK_KIFACE_BASE() : KIFACE_BASE( "common_test", KIWAY::KIWAY_FACE_COUNT ) {};
39 virtual ~MOCK_KIFACE_BASE() {};
40
41 MOCK_METHOD( OnKifaceStart, 2, bool( PGM_BASE*, int ) );
42 MOCK_METHOD( OnKifaceEnd, 0, void() );
43 MOCK_METHOD( CreateKiWindow, 4, wxWindow*( wxWindow*, int, KIWAY*, int ) );
44 MOCK_METHOD( IfaceOrAddress, 1, void*( int ) );
45};
46
47#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
48 _Pragma( "GCC diagnostic pop" )
49#endif
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
A KIFACE implementation.
Definition: kiface_base.h:39
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:274
@ KIWAY_FACE_COUNT
Definition: kiway.h:290
Container for data for KiCad programs.
Definition: pgm_base.h:95
void OnKifaceEnd() override
MOCK_BASE_CLASS(MOCK_KIFACE_BASE, KIFACE_BASE)