diff options
| author | Phil Nash | 2010-11-10 07:59:07 +0000 |
|---|---|---|
| committer | Phil Nash | 2010-11-10 07:59:07 +0000 |
| commit | 16a6dd57467da28552a05fd07198847b6ab0ddb7 (patch) | |
| tree | 6f8f4c65445c1a26e038212cfadfda1479ef3acb /Test/ConditionTests.cpp | |
| parent | 3455e55538f8650627244edd08139ce698166094 (diff) | |
| download | catch3-16a6dd57467da28552a05fd07198847b6ab0ddb7.tar.gz | |
Added note about ! operator
Diffstat (limited to 'Test/ConditionTests.cpp')
| -rw-r--r-- | Test/ConditionTests.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Test/ConditionTests.cpp b/Test/ConditionTests.cpp index 64897fd1..3eaec140 100644 --- a/Test/ConditionTests.cpp +++ b/Test/ConditionTests.cpp @@ -155,6 +155,12 @@ TEST_CASE( "failing/conditions/ordered", "Ordering comparison checks that should } // Not (!) tests +// The problem with the ! operator is that it has right-to-left associativity. +// This means we can't isolate it when we decompose. The simple CHECK( !false ) form, therefore, +// cannot have the operand value extracted. The test will work correctly, and the situation +// is detected and a warning issued. +// An alternative form of the macros (CHECK_NOT and EXPECT_NOT) can be used instead to capture +// the operand value. TEST_CASE( "succeeding/conditions/not", "'Not' checks that should succeed" ) { bool falseValue = false; |