|
| DRN_NETWORKING_TESTING_EXPORT bool | waitForSignal (const ::QSignalSpy &spy, std::chrono::milliseconds waitFor) |
| | Waits for a specific signal to be emitted within a given timeout duration. It is useful in testing scenarios to verify if a signal has been emitted within the specified time. It helps validate asynchronous behavior in components that rely on signals to notify changes or complete operations.
|
| DRN_NETWORKING_TESTING_EXPORT bool | waitForSignal (const ::QSignalSpy &spy, std::chrono::milliseconds waitFor, const ::qint32 minCount) |
| | Waits for a specific signal to be emitted within a given timeout duration. It is useful in testing scenarios to verify if a signal has been emitted within the specified time. It helps validate asynchronous behavior in components that rely on signals to notify changes or complete operations.
|
| DRN_NETWORKING_TESTING_EXPORT bool | waitUntil (const std::function< bool()> &waitCondition, const std::chrono::milliseconds &timeout) |
| | Provides a blocking wait until a condition is true or until a timeout occurs.
|
| DRN_NETWORKING_TESTING_EXPORT bool | waitWhile (const std::function< bool()> &waitCondition, const std::chrono::milliseconds &timeout) |
| | Provides a blocking wait while a condition is true or until a timeout occurs.
|
| DRN_NETWORKING_TESTING_EXPORT bool drn::networking::testing::waitForSignal |
( |
const ::QSignalSpy & | spy, |
|
|
std::chrono::milliseconds | waitFor ) |
|
nodiscard |
Waits for a specific signal to be emitted within a given timeout duration. It is useful in testing scenarios to verify if a signal has been emitted within the specified time. It helps validate asynchronous behavior in components that rely on signals to notify changes or complete operations.
The signal is monitored using a QSignalSpy object, which tracks signal emissions. If the signal is emitted within the specified timeout, the function completes successfully. Otherwise, the function blocks until the timeout expires.
- Parameters
-
| spy | The QSignalSpy instance that observes the signal to be tested. |
| waitFor | The maximum duration to wait for the signal to be emitted. |
Usage:
- Use this method in test cases involving asynchronous signal emissions.
- Make sure the QSignalSpy is properly connected to the desired signal before calling this function.
- Returns
- Gives true when the signal has been emitted before the timeout, false otherwise.
| DRN_NETWORKING_TESTING_EXPORT bool drn::networking::testing::waitForSignal |
( |
const ::QSignalSpy & | spy, |
|
|
std::chrono::milliseconds | waitFor, |
|
|
const ::qint32 | minCount ) |
|
nodiscard |
Waits for a specific signal to be emitted within a given timeout duration. It is useful in testing scenarios to verify if a signal has been emitted within the specified time. It helps validate asynchronous behavior in components that rely on signals to notify changes or complete operations.
The signal is monitored using a QSignalSpy object, which tracks signal emissions. If the signal is emitted within the specified timeout, the function completes successfully. Otherwise, the function blocks until the timeout expires.
- Parameters
-
| spy | The QSignalSpy instance that observes the signal to be tested. |
| waitFor | The maximum duration to wait for the signal to be emitted. |
| minCount | The minimum number of signal emissions required to stop waiting. |
Usage:
- Use this method in test cases involving asynchronous signal emissions.
- Make sure the QSignalSpy is properly connected to the desired signal before calling this function.
- Returns
- Gives true when the signal has been emitted at least minCount times before the timeout, false otherwise.