Leosac
0.8.0
Open Source Access Control
|
Base class for test fixtures, it defines a ZMQ context, a BUS and a sub socket connect to the bus. More...
#include <TestHelper.hpp>
Public Member Functions | |
TestHelper () | |
virtual | ~TestHelper () |
virtual void | SetUp () override final |
We need this 2-step initialization to prevent calling virtual method (run_module) in constructor. More... | |
Public Attributes | |
zmqpp::context | ctx_ |
A context for the test case. More... | |
MessageBus | bus_ |
A BUS identical to the one spawned by core. More... | |
zmqpp::socket | bus_sub_ |
A SUB socket connected to the previous bus. More... | |
zmqpp::socket | bus_push_ |
A PUSH socket to write on the bus. More... | |
std::unique_ptr< zmqpp::actor > | module_actor_ |
An actor, to run the module code the same way it would be run by the core. More... | |
Private Member Functions | |
virtual bool | run_module (zmqpp::socket *pipe)=0 |
Called in the module's actor's thread. More... | |
Base class for test fixtures, it defines a ZMQ context, a BUS and a sub socket connect to the bus.
Definition at line 116 of file TestHelper.hpp.
|
inline |
Definition at line 127 of file TestHelper.hpp.
|
inlinevirtual |
Definition at line 138 of file TestHelper.hpp.
|
privatepure virtual |
Called in the module's actor's thread.
Override this: Construct configuration for the module then run_test_module()
with appropriate parameters.
Implemented in Leosac::Test::LedTest, Leosac::Test::WiegandReaderTest, and Leosac::Test::RplethTest.
|
inlinefinaloverridevirtual |
We need this 2-step initialization to prevent calling virtual method (run_module) in constructor.
Definition at line 146 of file TestHelper.hpp.
MessageBus Leosac::Test::Helper::TestHelper::bus_ |
A BUS identical to the one spawned by core.
Definition at line 160 of file TestHelper.hpp.
zmqpp::socket Leosac::Test::Helper::TestHelper::bus_push_ |
A PUSH socket to write on the bus.
Definition at line 170 of file TestHelper.hpp.
zmqpp::socket Leosac::Test::Helper::TestHelper::bus_sub_ |
A SUB socket connected to the previous bus.
Definition at line 165 of file TestHelper.hpp.
zmqpp::context Leosac::Test::Helper::TestHelper::ctx_ |
A context for the test case.
Definition at line 155 of file TestHelper.hpp.
std::unique_ptr<zmqpp::actor> Leosac::Test::Helper::TestHelper::module_actor_ |
An actor, to run the module code the same way it would be run by the core.
Does NOT subscribe to anything.
Definition at line 176 of file TestHelper.hpp.