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

Function tests

loader/tests/src/test_map_mk_huge_pool.cpp:47–68  ·  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

45 /// @return Always returns bsl::exit_success.
46 ///
47 [[nodiscard]] constexpr auto
48 tests() noexcept -> bsl::exit_code
49 {
50 helpers::init();
51 constexpr auto func{&map_mk_huge_pool};
52
53 bsl::ut_scenario{"success"} = [&]() noexcept {
54 bsl::ut_given{} = [&]() noexcept {
55 mutable_span_t mut_pool{};
56 root_page_table_t mut_rpt{};
57 constexpr auto buf_size{0x2042_umx};
58 bsl::array<bsl::uint8, buf_size.get()> mut_buf{};
59 bsl::ut_when{} = [&]() noexcept {
60 mut_pool.addr = mut_buf.data();
61 mut_pool.size = mut_buf.size().get();
62 bsl::ut_then{} = [&]() noexcept {
63 helpers::ut_check(func(&mut_pool, &mut_rpt));
64 };
65 bsl::ut_cleanup{} = [&]() noexcept {
66 helpers::reset();
67 };
68 };
69 };
70 };
71

Callers 1

mainFunction · 0.70

Calls 5

initFunction · 0.85
ut_checkFunction · 0.85
resetFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected