From a7657d36e8c21109d0f50eab9faacaf2f383eb0e Mon Sep 17 00:00:00 2001 From: Sean Parent Date: Tue, 6 Aug 2024 13:03:01 -0700 Subject: [PATCH] Change expressions to `false` Windows warns about expressions that always evaluate as constants other than `true` and `false.` Rather than suppressing the warning, I'm changing the test cases to `false.` --- test/CMakeLists.txt | 6 +++--- test/precondition_failure_aborts.cpp | 2 +- test/precondition_failure_minimal.cpp | 2 +- test/precondition_failure_output.cpp | 2 +- test/precondition_failure_with_message_output.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 42256cd..f13d44d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -58,14 +58,14 @@ adobe_contract_checking_add_abort_test( adobe_contract_checking_add_abort_test( precondition_failure_output - "precondition_failure_output.cpp:9999: Precondition violated [(]1 < 0[)]") + "precondition_failure_output.cpp:9999: Precondition violated [(]false[)]") adobe_contract_checking_add_minimal_failure_test( - precondition_failure_minimal "[(]1 < [0]") + precondition_failure_minimal "[(]false[)]") adobe_contract_checking_add_abort_test( precondition_failure_with_message_output - "precondition_failure_with_message_output.cpp:9999: Precondition violated [(]1 < 0[)]. expected message") + "precondition_failure_with_message_output.cpp:9999: Precondition violated [(]false[)]. expected message") add_executable(throwing_tests throwing_tests.cpp) adobe_contract_checking_apply_standard_options(throwing_tests) diff --git a/test/precondition_failure_aborts.cpp b/test/precondition_failure_aborts.cpp index cef8ed0..61adf74 100644 --- a/test/precondition_failure_aborts.cpp +++ b/test/precondition_failure_aborts.cpp @@ -2,4 +2,4 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER() -int main() { ADOBE_PRECONDITION(1 < 0); } +int main() { ADOBE_PRECONDITION(false); } diff --git a/test/precondition_failure_minimal.cpp b/test/precondition_failure_minimal.cpp index 844f118..fde7c65 100644 --- a/test/precondition_failure_minimal.cpp +++ b/test/precondition_failure_minimal.cpp @@ -2,4 +2,4 @@ ADOBE_MINIMAL_CONTRACT_VIOLATION_HANDLER() -int main() { ADOBE_PRECONDITION(1 < 0); } +int main() { ADOBE_PRECONDITION(false); } diff --git a/test/precondition_failure_output.cpp b/test/precondition_failure_output.cpp index d5b7791..1cd72f0 100644 --- a/test/precondition_failure_output.cpp +++ b/test/precondition_failure_output.cpp @@ -5,5 +5,5 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER() int main() { #line 9999 - ADOBE_PRECONDITION(1 < 0); + ADOBE_PRECONDITION(false); } diff --git a/test/precondition_failure_with_message_output.cpp b/test/precondition_failure_with_message_output.cpp index dba8950..11f0426 100644 --- a/test/precondition_failure_with_message_output.cpp +++ b/test/precondition_failure_with_message_output.cpp @@ -5,5 +5,5 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER() int main() { #line 9999 - ADOBE_PRECONDITION(1 < 0, "expected message"); + ADOBE_PRECONDITION(false, "expected message"); }