KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
22#include <kiface_base.h>
23#include <config.h>
24
25// Suppress a warning that the mock methods don't override the base class methods because
26// turtlemocks doesn't seem to provide a way to actually annotate the methods with override.
27#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
28 _Pragma( "GCC diagnostic push" ) \
29 _Pragma( "GCC diagnostic ignored \"-Winconsistent-missing-override\"" )
30#endif
31
32MOCK_BASE_CLASS( MOCK_KIFACE_BASE, KIFACE_BASE )
33{
34 MOCK_KIFACE_BASE() : KIFACE_BASE( "common_test", KIWAY::KIWAY_FACE_COUNT ) {};
35 virtual ~MOCK_KIFACE_BASE() {};
36
37 MOCK_METHOD( OnKifaceStart, 3, bool( PGM_BASE*, int, KIWAY* ) );
38 MOCK_METHOD( OnKifaceEnd, 0, void() );
39 MOCK_METHOD( CreateKiWindow, 4, wxWindow*( wxWindow*, int, KIWAY*, int ) );
40 MOCK_METHOD( IfaceOrAddress, 1, void*( int ) );
41};
42
43#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
44 _Pragma( "GCC diagnostic pop" )
45#endif
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) 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:35
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:311
@ KIWAY_FACE_COUNT
Definition kiway.h:326
Container for data for KiCad programs.
Definition pgm_base.h:102
void OnKifaceEnd() override
MOCK_BASE_CLASS(MOCK_KIFACE_BASE, KIFACE_BASE)