<!-- 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.
| 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 |