O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the background steps

Here is how the background steps could be implemented by writing a Qt Test: these steps can be run in the init() private slot. As you might remember, in a Qt Test harness, all private slots are tests, and the init() slot gets invoked by the test harness before the execution of each test, and is thus very suitable for implementing the execution of any background steps:

// tst_uc_broadcaster_publishes_sensor_readings.cpp...void Uc_broadcaster_publishes_sensor_readings::init(){    // Given there is a broadcaster    // And there is a sensor    // And the broadcaster connects to the sensor}

First, we need to create a Broadcaster instance and a Sensor instance. Both will be entities. Since these will need to be accessed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required