KiCad PCB EDA Suite
Loading...
Searching...
No Matches
mock_pgm_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 CHANGELOG.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 <pgm_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_PGM_BASE, PGM_BASE )
33{
34 MOCK_PGM_BASE() : PGM_BASE() {};
35 virtual ~MOCK_PGM_BASE() {};
36
37 MOCK_METHOD( MacOpenFile, 1, void( const wxString& ) );
38 MOCK_METHOD( SetTextEditor, 1, void( const wxString& ) );
39 MOCK_METHOD( GetTextEditor, 1, wxString&( bool ) );
40 MOCK_METHOD( AskUserForPreferredEditor, 1, const wxString( const wxString& ) );
41 MOCK_CONST_METHOD( IsKicadEnvVariableDefined, 0, bool() );
42 MOCK_CONST_METHOD( GetKicadEnvVariable, 0, const wxString&() );
43 MOCK_CONST_METHOD( GetPdfBrowserName, 0, const wxString&() );
44 MOCK_METHOD( SetPdfBrowserName, 1, void( const wxString& ) );
45 MOCK_CONST_METHOD( UseSystemPdfBrowser, 0, bool() );
46 MOCK_METHOD( ForceSystemPdfBrowser, 1, void( bool ) );
47 MOCK_METHOD( SetLanguage, 2, bool( wxString&, bool ) );
48 MOCK_METHOD( SetLanguageIdentifier, 1, void( int ) );
49 MOCK_METHOD( ReadPdfBrowserInfos, 0, void() );
50 MOCK_METHOD( WritePdfBrowserInfos, 0, void() );
51 MOCK_METHOD( SetLocalEnvVariable, 2, bool( const wxString&, const wxString& ) );
52 MOCK_METHOD( SetLocalEnvVariables, 0, void() );
53
54 int GetSelectedLanguageIdentifier() const override
55 {
56 return 0;
57 }
58
59 // following functions will not be mocked in order to mimic old qa behavior
60// MOCK_METHOD( App, 0, wxApp&() );
61// MOCK_METHOD( GetLocale, 0, wxLocale*() );
62// MOCK_METHOD( GetSettingsManager, 0, SETTINGS_MANAGER&() );
63// MOCK_METHOD( SetLanguagePath, 0, void() );
64// MOCK_CONST_METHOD( GetExecutablePath, 0, const wxString&() );
65// MOCK_METHOD( GetSettingsManager, 0, SETTINGS_MANAGER&() );
66};
67
68#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
69 _Pragma( "GCC diagnostic pop" )
70#endif
Container for data for KiCad programs.
Definition pgm_base.h:102
MOCK_BASE_CLASS(MOCK_PGM_BASE, PGM_BASE)
see class PGM_BASE