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

Base class for test cases with one virtual node on a CANbus interface. More...

#include <async_if_test_helper.hxx>

Inheritance diagram for openlcb::AsyncNodeTest:
openlcb::AsyncIfTest AsyncCanTest openlcb::AsyncDatagramTest openlcb::TractionTest openlcb::TwoNodeDatagramTest openlcb::StreamTestBase

Protected Member Functions

void wait_for_event_thread ()
 
- Protected Member Functions inherited from openlcb::AsyncIfTest
void create_allocated_alias ()
 Creates an alias allocator flow, and injects an already allocated alias.
 
void inject_allocated_alias (NodeAlias alias)
 
void expect_next_alias_allocation (NodeAlias a=0)
 
BarrierNotifiableget_notifiable ()
 
void wait_for_notification ()
 
- Protected Member Functions inherited from AsyncCanTest
void wait ()
 Delays the current thread until we are certain that all asynchrnous processing has completed.
 
void twait ()
 Delays the current thread until all asynchronous processing and all pending timers have completed.
 
void expect_any_packet ()
 Ignores all produced packets.
 
void print_all_packets ()
 Prints all packets sent to the canbus until the end of the current test function.
 
void send_packet (const string &gc_packet)
 Injects a packet to the interface.
 
void clear_expect (bool strict=false)
 Clears all existing expectations on the CAN-bus packets.
 
void send_packet_and_flush_expect (const string &pkt)
 Sends a packet to the canbus, waits for the executor to clear, and then verifies all previous expectations.
 

Protected Attributes

EventService eventService_
 
std::unique_ptr< DefaultNodeownedNode_
 
Nodenode_
 
- Protected Attributes inherited from openlcb::AsyncIfTest
SyncNotifiable n_
 
BarrierNotifiable bn_
 
std::unique_ptr< IfCanifCan_
 The interface under test.
 
AliasInfo testAlias_
 Temporary object used to send aliases around in the alias allocator flow.
 
NodeAlias aliasSeed_
 The next alias we will make the allocator create.
 
bool pendingAliasAllocation_
 true if we have a pending async alias allocation task.
 
- Protected Attributes inherited from AsyncCanTest
NiceMock< MockSendcanBus_
 Helper object for setting expectations on the packets sent on the bus.
 
std::unique_ptr< HubPortprinter_
 Object for debug-printing every packet (if requested).
 

Additional Inherited Members

- Static Public Member Functions inherited from AsyncCanTest
static void SetUpTestCase ()
 Initializes test case with CAN0.
 
static void TearDownTestCase ()
 De-Initializes test case with CAN0.
 
- Static Protected Attributes inherited from openlcb::AsyncIfTest
static int local_alias_cache_size = 10
 
static int local_node_count = 9
 
static int remote_alias_cache_size = 10
 

Detailed Description

Base class for test cases with one virtual node on a CANbus interface.

Definition at line 476 of file async_if_test_helper.hxx.

Constructor & Destructor Documentation

◆ AsyncNodeTest()

openlcb::AsyncNodeTest::AsyncNodeTest ( )
inlineprotected

Definition at line 479 of file async_if_test_helper.hxx.

◆ ~AsyncNodeTest()

openlcb::AsyncNodeTest::~AsyncNodeTest ( )
inlineprotected

Definition at line 491 of file async_if_test_helper.hxx.

Member Function Documentation

◆ wait_for_event_thread()

void openlcb::AsyncNodeTest::wait_for_event_thread ( )
inlineprotected

Definition at line 496 of file async_if_test_helper.hxx.

Member Data Documentation

◆ eventService_

EventService openlcb::AsyncNodeTest::eventService_
protected

Definition at line 509 of file async_if_test_helper.hxx.

◆ node_

Node* openlcb::AsyncNodeTest::node_
protected

Definition at line 511 of file async_if_test_helper.hxx.

◆ ownedNode_

std::unique_ptr<DefaultNode> openlcb::AsyncNodeTest::ownedNode_
protected

Definition at line 510 of file async_if_test_helper.hxx.


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