Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::MockTrain Class Reference

Test helper class for TrainImpl using GoogleMock. More...

#include <MockTrain.hxx>

Inheritance diagram for openlcb::MockTrain:
openlcb::TrainImpl

Public Member Functions

 MOCK_METHOD1 (set_speed, void(SpeedType speed))
 
 MOCK_METHOD0 (get_speed, SpeedType())
 
 MOCK_METHOD0 (get_commanded_speed, SpeedType())
 
 MOCK_METHOD0 (get_actual_speed, SpeedType())
 
 MOCK_METHOD0 (set_emergencystop, void())
 
 MOCK_METHOD0 (get_emergencystop, bool())
 
 MOCK_METHOD2 (set_fn, void(uint32_t address, uint16_t value))
 
 MOCK_METHOD1 (get_fn, uint16_t(uint32_t address))
 
 MOCK_METHOD0 (legacy_address, uint32_t())
 
 MOCK_METHOD0 (legacy_address_type, dcc::TrainAddressType())
 
- Public Member Functions inherited from openlcb::TrainImpl
virtual void set_speed (SpeedType speed)=0
 Sets the speed of the locomotive.
 
virtual SpeedType get_speed ()=0
 
virtual SpeedType get_commanded_speed ()
 
virtual SpeedType get_actual_speed ()
 Returns the actual speed of the locomotive, as provided by feedback from the decoder.
 
virtual void set_emergencystop ()=0
 Sets the train to emergency stop.
 
virtual bool get_emergencystop ()=0
 Get the current E-Stop state.
 
virtual void set_fn (uint32_t address, uint16_t value)=0
 Sets the value of a function.
 
virtual uint16_t get_fn (uint32_t address)=0
 
virtual uint32_t legacy_address ()=0
 
virtual dcc::TrainAddressType legacy_address_type ()=0
 

Detailed Description

Test helper class for TrainImpl using GoogleMock.

Allows creating a train node without an implementation. All calls have to have an explicit expectation using the GoogleMock framework.

Definition at line 14 of file MockTrain.hxx.


The documentation for this class was generated from the following file: