<!-- 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.
| 44 | /// @return Always returns bsl::exit_success. |
| 45 | /// |
| 46 | [[nodiscard]] constexpr auto |
| 47 | tests() noexcept -> bsl::exit_code |
| 48 | { |
| 49 | helpers::init(); |
| 50 | constexpr auto func{&dump_vmm}; |
| 51 | |
| 52 | bsl::ut_scenario{"success"} = [&]() noexcept { |
| 53 | bsl::ut_given{} = [&]() noexcept { |
| 54 | dump_vmm_args_t mut_args{}; |
| 55 | bsl::ut_when{} = [&]() noexcept { |
| 56 | helpers::ut_check(loader_init()); |
| 57 | mut_args.ver = bsl::safe_u64::magic_1().get(); |
| 58 | bsl::ut_then{} = [&]() noexcept { |
| 59 | helpers::ut_check(func(&mut_args)); |
| 60 | }; |
| 61 | bsl::ut_cleanup{} = [&]() noexcept { |
| 62 | helpers::ut_check(loader_fini()); |
| 63 | helpers::reset(); |
| 64 | }; |
| 65 | }; |
| 66 | }; |
| 67 | }; |
| 68 | |
| 69 | bsl::ut_scenario{"invalid version"} = [&]() noexcept { |
| 70 | bsl::ut_given{} = [&]() noexcept { |
| 71 | dump_vmm_args_t mut_args{}; |
| 72 | bsl::ut_when{} = [&]() noexcept { |
| 73 | helpers::ut_check(loader_init()); |
| 74 | mut_args.ver = bsl::safe_u64::magic_0().get(); |
| 75 | bsl::ut_then{} = [&]() noexcept { |
| 76 | helpers::ut_fails(func(&mut_args)); |
| 77 | }; |
| 78 | bsl::ut_cleanup{} = [&]() noexcept { |
| 79 | helpers::ut_check(loader_fini()); |
| 80 | helpers::reset(); |
| 81 | }; |
| 82 | }; |
| 83 | }; |
| 84 | }; |
| 85 | |
| 86 | return helpers::fini(); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /// <!-- description --> |
no test coverage detected