#include <fake_dispatcher_fixture.h>
|
FakeDispatcher & | dispatcher () |
| Returns the FakeDispatcher that should be used for dependency injection.
|
|
chrono::SystemClock::time_point | now () |
| Returns the current fake time.
|
|
bool | RunUntilIdle () |
|
bool | RunUntil (chrono::SystemClock::time_point end_time) |
|
bool | RunFor (chrono::SystemClock::duration duration) |
|
| Test (const Test &)=delete |
|
Test & | operator= (const Test &)=delete |
|
void | PigweedTestRun () |
|
|
static void | SetUpTestSuite () |
|
static void | TearDownTestSuite () |
|
static bool | HasFailure () |
|
virtual void | SetUp () |
|
virtual void | TearDown () |
|
Test fixture that is a simple wrapper around a FakeDispatcher.
Example:
TEST_F(ExampleTest, Example) {
obj.ScheduleSomeTasks();
EXPECT_TRUE(some condition);
obj.ScheduleTaskToRunIn30Seconds();
EXPECT_TRUE(task ran);
}
Definition: fake_dispatcher_fixture.h:39
FakeDispatcher & dispatcher()
Returns the FakeDispatcher that should be used for dependency injection.
Definition: fake_dispatcher_fixture.h:42
bool RunFor(chrono::SystemClock::duration duration)
Definition: fake_dispatcher_fixture.h:61
bool RunUntilIdle()
Definition: fake_dispatcher_fixture.h:49
◆ RunFor()
Dispatches all tasks with due times up to now() + duration
, progressively advancing the fake clock. Returns true iff any tasks were invoked during the run.
◆ RunUntil()
bool pw::async::test::FakeDispatcherFixture::RunUntil |
( |
chrono::SystemClock::time_point |
end_time | ) |
|
|
inline |
Dispatches all tasks with due times up to end_time
, progressively advancing the fake clock. Returns true iff any tasks were invoked during the run.
◆ RunUntilIdle()
bool pw::async::test::FakeDispatcherFixture::RunUntilIdle |
( |
| ) |
|
|
inline |
Dispatches all tasks with due times up until now()
. Returns true iff any tasks were invoked during the run.
The documentation for this class was generated from the following file: