diff --git a/tests/no_exception_ensure_tests.cpp b/tests/no_exception_ensure_tests.cpp index 3a7f007..b1ae15b 100644 --- a/tests/no_exception_ensure_tests.cpp +++ b/tests/no_exception_ensure_tests.cpp @@ -14,21 +14,17 @@ // /////////////////////////////////////////////////////////////////////////////// -#include // for std::exit -#include // for span +#include // for std::exit +#include // for span int operator_subscript_no_throw() noexcept { - int arr[10]; - const gsl::span sp { arr }; + int arr[10]; + const gsl::span sp{arr}; return sp[11]; } - -void test_terminate() -{ - std::exit(0); -} +[[noreturn]] void test_terminate() { std::exit(0); } void setup_termination_handler() noexcept { @@ -44,7 +40,6 @@ void setup_termination_handler() noexcept #endif } - int main() noexcept { setup_termination_handler(); diff --git a/tests/no_exception_throw_tests.cpp b/tests/no_exception_throw_tests.cpp index e9f4dac..b28ad00 100644 --- a/tests/no_exception_throw_tests.cpp +++ b/tests/no_exception_throw_tests.cpp @@ -14,20 +14,17 @@ // /////////////////////////////////////////////////////////////////////////////// -#include // for std::exit -#include // for narrow +#include // for std::exit #include // for get_terminate +#include // for narrow int narrow_no_throw() { const long long bigNumber = 0x0fffffffffffffff; - return gsl::narrow(bigNumber); + return gsl::narrow(bigNumber); } -void test_terminate() -{ - std::exit(0); -} +[[noreturn]] void test_terminate() { std::exit(0); } void setup_termination_handler() noexcept { @@ -43,7 +40,6 @@ void setup_termination_handler() noexcept #endif } - int main() { setup_termination_handler();