3#define BOOST_TEST_MODULE testPeriodicTrigger
9#include <boost/test/included/unit_test.hpp>
13 using namespace boost::unit_test_framework;
28 PeriodicTrigger p{
this,
"SomeTimer",
"", 1000, {},
"/Config/timerPeriod",
"../tickTock"};
39 test.runApplication();
41 auto tick = test.getScalar<uint64_t>(
"/tickTock");
43 BOOST_CHECK(
tick.getVersionNumber() != VersionNumber{nullptr});
44 BOOST_CHECK_EQUAL(
static_cast<uint64_t
>(
tick), 0);
49 BOOST_CHECK_NO_THROW((
void)test.getScalar<uint32_t>(
"/Config/timerPeriod"));
51 auto oldVersion =
tick.getVersionNumber();
54 test.writeScalar<
int>(
"/SomeModule/in", 42);
56 test.stepApplication();
59 BOOST_CHECK(
tick.getVersionNumber() > oldVersion);
60 BOOST_CHECK_EQUAL(
static_cast<uint64_t
>(
tick), 1);
void shutdown() override
This will remove the global pointer to the instance and allows creating another instance afterwards.
ApplicationModule()=default
Default constructor: Allows late initialisation of modules (e.g.
Helper class to facilitate tests of applications based on ApplicationCore.
InvalidityTracer application module.
BOOST_AUTO_TEST_CASE(testIterface)
Simple periodic trigger that fires a variable once per second.
~TestApplication() override
ScalarPushInput< int > in
void mainLoop() override
To be implemented by the user: function called in a separate thread executing the main loop of the mo...
ctk::ScalarOutput< uint64_t > tick