* @brief Helper method to run scheduler until condition is met or timeout * * Executes the scheduler repeatedly until either the specified condition * returns true or the timeout period expires. Essential for testing * time-dependent scheduler behavior without creating infinite loops. * * @param ts Reference to the Scheduler object to execute * @param condition
| 119 | * @return true if condition was met within timeout, false otherwise |
| 120 | */ |
| 121 | bool runSchedulerUntil(Scheduler& ts, std::function<bool()> condition, unsigned long timeout_ms = 1000) { |
| 122 | return waitForCondition([&]() { |
| 123 | ts.execute(); |
| 124 | return condition(); |
| 125 | }, timeout_ms); |
| 126 | } |
| 127 | }; |
| 128 | |
| 129 | /** |
nothing calls this directly
no test coverage detected