MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / tests

Function tests

loader/tests/src/x64/test_dump_mk_state.cpp:44–63  ·  view source on GitHub ↗

<!-- description --> @brief Used to execute the actual checks. We put the checks in this function so that we can validate the tests both at compile-time and at run-time. If a bsl::ut_check fails, the tests will either fail fast at run-time, or will produce a compile-time error. <!-- inputs/outputs --> @return Always returns bsl::exit_success.

Source from the content-addressed store, hash-verified

42 /// @return Always returns bsl::exit_success.
43 ///
44 [[nodiscard]] constexpr auto
45 tests() noexcept -> bsl::exit_code
46 {
47 helpers::init_x64();
48 constexpr auto func{&dump_mk_state};
49
50 bsl::ut_scenario{"success"} = [&]() noexcept {
51 bsl::ut_given{} = [&]() noexcept {
52 state_save_t mut_state{};
53 tss_t mut_tss{};
54 bsl::ut_when{} = [&]() noexcept {
55 mut_state.tss = &mut_tss;
56 bsl::ut_then{} = [&]() noexcept {
57 func(&mut_state, {});
58 };
59 bsl::ut_cleanup{} = [&]() noexcept {
60 helpers::reset_x64();
61 };
62 };
63 };
64 };
65
66 return helpers::fini();

Callers 1

mainFunction · 0.70

Calls 2

init_x64Function · 0.85
reset_x64Function · 0.85

Tested by

no test coverage detected