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
21
22#include <qa_utils/mock_utils.h>
23
24#include <kiface_base.h>
25#include <config.h>
26
27// Suppress a warning that the mock methods don't override the base class methods because
28// turtlemocks doesn't seem to provide a way to actually annotate the methods with override.
29#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
30 _Pragma( "GCC diagnostic push" ) \
31 _Pragma( "GCC diagnostic ignored \"-Winconsistent-missing-override\"" )
32#endif
33
34MOCK_BASE_CLASS( MOCK_KIFACE_BASE, KIFACE_BASE )
35{
36 MOCK_KIFACE_BASE() : KIFACE_BASE( "common_test", KIWAY::KIWAY_FACE_COUNT ) {};
37 virtual ~MOCK_KIFACE_BASE() {};
38
39 MOCK_METHOD( OnKifaceStart, 3, bool( PGM_BASE*, int, KIWAY* ) );
40 MOCK_METHOD( OnKifaceEnd, 0, void() );
41 MOCK_METHOD( CreateKiWindow, 4, wxWindow*( wxWindow*, int, KIWAY*, int ) );
42 MOCK_METHOD( IfaceOrAddress, 1, void*( int ) );
43};
44
45#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
46 _Pragma( "GCC diagnostic pop" )
47#endif
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:348
@ KIWAY_FACE_COUNT
Definition kiway.h:361
Container for data for KiCad programs.
Definition pgm_base.h:101
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition cvpcb.cpp:31
void OnKifaceEnd() override
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Definition cvpcb.cpp:10
MOCK_BASE_CLASS(MOCK_KIFACE_BASE, KIFACE_BASE)