class AsyncTest
Defined at line 19 of file ../../src/sys/fuzzing/common/testing/async-test.h
This class acts as a base class for various unit tests. It extends gTest's |Test| class
by providing an async loop for testing with an |async::Executor| has been set up.
Protected Methods
async_dispatcher_t * dispatcher ()
Defined at line 21 of file ../../src/sys/fuzzing/common/testing/async-test.h
const ExecutorPtr & executor ()
Defined at line 22 of file ../../src/sys/fuzzing/common/testing/async-test.h
size_t active ()
Defined at line 23 of file ../../src/sys/fuzzing/common/testing/async-test.h
void SetUp ()
Defined at line 25 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler>
void Schedule (Handler handler)
Runs a promise using this object's test loop.
Defined at line 39 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler>
Promise<> ExpectOk (const char * file, int line, Handler && handler)
Checks if a promise returns ok. |handler| can be anything that can be passed to
|fpromise::make_promise| to make a promise.
Callers should use |EXPECT_OK| instead of calling this directly.
Defined at line 53 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler, typename ValueType>
Promise<> ExpectOk (const char * file, int line, Handler && handler, ValueType expected)
Checks if a promise returns an|expected| value. |handler| can be anything that can be passed to
|fpromise::make_promise| to make a promise.
Callers should use |EXPECT_OK| instead of calling this directly.
Defined at line 68 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler, typename ValueType>
Promise<> ExpectOk (const char * file, int line, Handler && handler, ValueType * out)
Checks if a promise returns ok and returns its value via |out|. |handler| can be anything that
can be passed to |fpromise::make_promise| to make a promise.
Callers should use |EXPECT_OK| instead of calling this directly.
Defined at line 85 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler>
Promise<> ExpectError (const char * file, int line, Handler && handler)
Checks if a promise returns an error. |handler| can be anything that can be passed to
|fpromise::make_promise| to make a promise.
Callers should use |EXPECT_ERROR| instead of calling this directly.
Defined at line 103 of file ../../src/sys/fuzzing/common/testing/async-test.h
template <typename Handler, typename ErrorType>
Promise<> ExpectError (const char * file, int line, Handler && handler, ErrorType expected)
Checks if a promise returns an |expected| error. |handler| can be anything that can be passed
to |fpromise::make_promise| to make a promise.
Callers should use |EXPECT_ERROR| instead of calling this directly.
Defined at line 118 of file ../../src/sys/fuzzing/common/testing/async-test.h
void RunUntilIdle ()
Runs the test async loop.
Defined at line 130 of file ../../src/sys/fuzzing/common/testing/async-test.h
void RunOnce ()
Defined at line 144 of file ../../src/sys/fuzzing/common/testing/async-test.h
void TearDown ()
Checks for unfinished promises at test end.
Defined at line 147 of file ../../src/sys/fuzzing/common/testing/async-test.h