<!-- description --> @brief Main function for this unit test. If a call to bsl::ut_check() fails the application will fast fail. If all calls to bsl::ut_check() pass, this function will successfully return with bsl::exit_success. <!-- inputs/outputs --> @return Always returns bsl::exit_success.
| 37 | /// @return Always returns bsl::exit_success. |
| 38 | /// |
| 39 | [[nodiscard]] auto |
| 40 | main() noexcept -> bsl::exit_code |
| 41 | { |
| 42 | constexpr auto queue_size{3_umx}; |
| 43 | |
| 44 | bsl::ut_scenario{"verify noexcept"} = [&]() noexcept { |
| 45 | bsl::ut_given{} = [&]() noexcept { |
| 46 | bool mut_val{}; |
| 47 | lib::basic_queue_t<bool, queue_size.get()> mut_queue{}; |
| 48 | lib::basic_queue_t<bool, queue_size.get()> const queue{}; |
| 49 | bsl::ut_then{} = [&]() noexcept { |
| 50 | static_assert(noexcept(lib::basic_queue_t<bool, queue_size.get()>{})); |
| 51 | |
| 52 | static_assert(noexcept(mut_queue.push({}))); |
| 53 | static_assert(noexcept(mut_queue.pop(mut_val))); |
| 54 | static_assert(noexcept(mut_queue.empty())); |
| 55 | static_assert(noexcept(mut_queue.full())); |
| 56 | static_assert(noexcept(mut_queue.size())); |
| 57 | |
| 58 | static_assert(noexcept(queue.empty())); |
| 59 | static_assert(noexcept(queue.full())); |
| 60 | static_assert(noexcept(queue.size())); |
| 61 | }; |
| 62 | }; |
| 63 | }; |
| 64 | |
| 65 | return bsl::ut_success(); |
| 66 | } |