KiCad PCB EDA Suite
common_mocks.cpp File Reference

Mock objects for libcommon unit tests. More...

#include <pgm_base.h>
#include <kiface_i.h>

Go to the source code of this file.

Classes

struct  PGM_TEST_FRAME
 
struct  IFACE
 

Functions

PGM_BASEPgm ()
 The global Program "get" accessor. More...
 
IFACE KIFACE_I kiface ("common_test", KIWAY::KIWAY_FACE_COUNT)
 
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override
 
wxWindow * CreateWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
 
void * IfaceOrAddress (int aDataId) override
 
 IFACE (const char *aDSOname, KIWAY::FACE_T aType)
 
KIFACE_IKiface ()
 Global KIFACE_I "get" accessor. More...
 

Detailed Description

Mock objects for libcommon unit tests.

Definition in file common_mocks.cpp.

Function Documentation

◆ CreateWindow()

wxWindow* kiface::CreateWindow ( wxWindow *  aParent,
int  aClassId,
KIWAY aKiway,
int  aCtlBits = 0 
)
override

Definition at line 45 of file common_mocks.cpp.

45  : public KIFACE_I
46 {
47  bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) override
48  {
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
KIFACE_I is a KIFACE (I)mplementation, with some features useful for DSOs which implement a KIFACE.
Definition: kiface_i.h:37
PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:137
int PGM_BASE * aProgram
Definition: cvpcb/cvpcb.cpp:97

◆ IFACE()

kiface::IFACE ( const char *  aDSOname,
KIWAY::FACE_T  aType 
)

Definition at line 55 of file common_mocks.cpp.

58  {

◆ IfaceOrAddress()

void* kiface::IfaceOrAddress ( int  aDataId)
override

Definition at line 50 of file common_mocks.cpp.

53  {

◆ kiface()

IFACE KIFACE_I kiface ( "common_test"  ,
KIWAY::KIWAY_FACE_COUNT   
)
static

Referenced by Kiface().

◆ Kiface()

KIFACE_I& Kiface ( )

Global KIFACE_I "get" accessor.

Definition at line 68 of file common_mocks.cpp.

69 {
70  return kiface;
71 }
IFACE KIFACE_I kiface("common_test", KIWAY::KIWAY_FACE_COUNT)

References kiface().

◆ OnKifaceStart()

bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
)
override

Definition at line 40 of file common_mocks.cpp.

40 {
41  static PGM_TEST_FRAME program;
42  return program;
43 }
PGM_SINGLE_TOP program

References program.

◆ Pgm()

PGM_BASE& Pgm ( )

The global Program "get" accessor.

Implemented in: 1) common/single_top.cpp, 2) kicad/kicad.cpp, and 3) scripting/kiway.i

Definition at line 39 of file common_mocks.cpp.

40 {
41  static PGM_TEST_FRAME program;
42  return program;
43 }
PGM_SINGLE_TOP program