Skip to content

Commit

Permalink
🎨 Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Clang Robot committed Aug 6, 2024
1 parent 262bf6f commit 8ae3bd8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
15 changes: 8 additions & 7 deletions test/abort_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstdlib>
#include <csignal>
#include <cstdio>
#include <cstdlib>

// 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.
Expand Down
4 changes: 1 addition & 3 deletions test/abort_is_detected.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <cstdlib>

int main() {
std::abort();
}
int main() { std::abort(); }
4 changes: 1 addition & 3 deletions test/precondition_failure_aborts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER()

int main() {
ADOBE_PRECONDITION(1 < 0);
}
int main() { ADOBE_PRECONDITION(1 < 0); }
5 changes: 1 addition & 4 deletions test/precondition_failure_minimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

ADOBE_MINIMAL_CONTRACT_VIOLATION_HANDLER()

int main()
{
ADOBE_PRECONDITION(1 < 0);
}
int main() { ADOBE_PRECONDITION(1 < 0); }

0 comments on commit 8ae3bd8

Please sign in to comment.