diff --git a/test/abort_detection.cpp b/test/abort_detection.cpp index 849b0e7..162eb06 100644 --- a/test/abort_detection.cpp +++ b/test/abort_detection.cpp @@ -2,28 +2,29 @@ // a special message to stderr and exit with EXIT_FAILURE instead of // having its usual behavior, allowing our tests to detect that // abort() was called by checking for the message. -#include #include #include +#include // A signal handler that prints "##ABORTED##" to stderr and exits with // EXIT_FAILURE. // // The printed string is chosen to be unlikely to appear by accident // in other output. -extern "C" void error_test_handle_abort(int /* unused signum */) { - (void)std::fprintf(stderr, "##ABORTED##"); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg) +extern "C" void error_test_handle_abort(int /* unused signum */) +{ + (void)std::fprintf( + stderr, "##ABORTED##");// NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg) std::_Exit(EXIT_FAILURE); } // Abort handler installer. -struct test_override_abort { +struct test_override_abort +{ // As a side-effect, installs error_test_handle_abort as a SIGABRT // handler. - test_override_abort() noexcept { - (void)std::signal(SIGABRT, error_test_handle_abort); - } + test_override_abort() noexcept { (void)std::signal(SIGABRT, error_test_handle_abort); } }; // The installation of error_test_handle_abort as an abort handler. diff --git a/test/abort_is_detected.cpp b/test/abort_is_detected.cpp index 8a138b7..a3aa834 100644 --- a/test/abort_is_detected.cpp +++ b/test/abort_is_detected.cpp @@ -1,5 +1,3 @@ #include -int main() { - std::abort(); -} +int main() { std::abort(); } diff --git a/test/precondition_failure_aborts.cpp b/test/precondition_failure_aborts.cpp index 1d94b47..cef8ed0 100644 --- a/test/precondition_failure_aborts.cpp +++ b/test/precondition_failure_aborts.cpp @@ -2,6 +2,4 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER() -int main() { - ADOBE_PRECONDITION(1 < 0); -} +int main() { ADOBE_PRECONDITION(1 < 0); } diff --git a/test/precondition_failure_minimal.cpp b/test/precondition_failure_minimal.cpp index 950fc1e..844f118 100644 --- a/test/precondition_failure_minimal.cpp +++ b/test/precondition_failure_minimal.cpp @@ -2,7 +2,4 @@ ADOBE_MINIMAL_CONTRACT_VIOLATION_HANDLER() -int main() -{ - ADOBE_PRECONDITION(1 < 0); -} +int main() { ADOBE_PRECONDITION(1 < 0); }