Skip to content

Commit

Permalink
Change expressions to false
Browse files Browse the repository at this point in the history
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.`
  • Loading branch information
sean-parent committed Aug 6, 2024
1 parent 37e976f commit a7657d3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/precondition_failure_aborts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER()

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

ADOBE_MINIMAL_CONTRACT_VIOLATION_HANDLER()

int main() { ADOBE_PRECONDITION(1 < 0); }
int main() { ADOBE_PRECONDITION(false); }
2 changes: 1 addition & 1 deletion test/precondition_failure_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER()
int main()
{
#line 9999
ADOBE_PRECONDITION(1 < 0);
ADOBE_PRECONDITION(false);
}
2 changes: 1 addition & 1 deletion test/precondition_failure_with_message_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ ADOBE_DEFAULT_CONTRACT_VIOLATION_HANDLER()
int main()
{
#line 9999
ADOBE_PRECONDITION(1 < 0, "expected message");
ADOBE_PRECONDITION(false, "expected message");
}

0 comments on commit a7657d3

Please sign in to comment.