class DlLoadZirconTestsBase
Defined at line 23 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
DlLoadZirconTestsBase contains Fuchsia-specific types and logic for running
tests on Fuchsia. This subclass overrides methods from DlLoadTestsBase as
needed to test Fuchsia-specific behavior. In particular, this class provides
a MockLoaderServiceForTest that tests should use in the place of the normal
system loader service so as to interact with the Expect/Needed API. The
Expect/Needed API verifies that modules and/or dependencies were loaded by
the fuchsia.ldsvc.Loader as expected.
Public Methods
fit::result<std::optional<SystemError>, DlLoadZirconTestsBase::File> RetrieveFile (Diagnostics & diag, std::string_view filename)
Retrieve a VMO from the test package. If the file is not found, a
fit::error{std::nullopt} is returned to the caller, otherwise a
fit::error{ZirconError} is returned containing information about the
encountered system error.
Defined at line 16 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.cc
void ExpectRootModule (std::string_view name)
`ExpectRootModule` will prime the mock loader with the root module and
register an expectation for it. Usually, `ExpectRootModule` is used for the
module that is being `dlopen`-ed and should be called before `Needed` for
the mock loader to expect to load the root module before its dependencies.
Defined at line 34 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
void ExpectMissing (std::string_view name)
Defined at line 36 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
void Needed (std::initializer_list<std::string_view> names)
`Needed` registers the ordered set of dependencies the mock loader is
expected to load. Likewise, tests must intersperse calls to all
Expect*/Needed methods in the order they are expected to be received by
the mock loader.
Defined at line 42 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
void Needed (std::initializer_list<std::pair<std::string_view, bool>> name_found_pairs)
Defined at line 44 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
void CallWithLdsvcInstalled (fit::closure func)
Defined at line 48 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h
void VerifyAndClearNeeded ()
Defined at line 50 of file ../../sdk/lib/c/dlfcn/dl/test/dl-load-zircon-tests-base.h