Skip to content

Commit

Permalink
Merge branch 'sean-parent/fixing-ci' of https://github.com/stlab/adob…
Browse files Browse the repository at this point in the history
…e-contract-checks into sean-parent/fixing-ci
  • Loading branch information
sean-parent committed Aug 6, 2024
2 parents 02ca070 + 8ae3bd8 commit 37e976f
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); }

Check warning on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check failure on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug

the following warning is treated as an error [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check warning on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check failure on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release

the following warning is treated as an error [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check warning on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check warning on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]

Check warning on line 5 in test/precondition_failure_aborts.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_aborts.vcxproj]
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); }

Check warning on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check failure on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug

the following warning is treated as an error [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check warning on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check failure on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release

the following warning is treated as an error [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check warning on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check warning on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Release (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

Check warning on line 5 in test/precondition_failure_minimal.cpp

View workflow job for this annotation

GitHub Actions / windows-2022 msvc Debug (maintainer mode)

conditional expression is constant [D:\a\adobe-contract-checks\adobe-contract-checks\build\test\precondition_failure_minimal.vcxproj]

0 comments on commit 37e976f

Please sign in to comment.