|
Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
|
Unit tests for the Qt signals and slots demonstration. More...
#include <QCoreApplication>#include <QString>#include <cassert>#include <iostream>#include "qt_signals/qt_signals.hpp"Functions | |
| int | main (int argc, char *argv[]) |
Unit tests for the Qt signals and slots demonstration.
This file contains tests to verify that the QtSignalsExample class correctly emits signals and that these signals can be received by connected slots. The test creates an instance of QtSignalsExample, connects its signal to a lambda function that records the received message, and then emits a test signal. Assertions verify that the slot is called and that the received message matches the expected value.
To run this test, a QCoreApplication is instantiated to provide the necessary Qt event loop, even though the direct connection should be immediate.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |