Stop accepting non-const comparison operators

A) non-const comparison operators should not exist and should not be
encouraged

B) The logic breaks comparing function pointers certain way

C) It was inconsistent anyway, as it only applied to `==` and `!=`

Closes #925
This commit is contained in:
Martin Hořeňovský
2017-09-06 14:42:44 +02:00
parent aef2e4d9e7
commit b000411434
6 changed files with 56 additions and 58 deletions

View File

@@ -169,6 +169,17 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#925: comparing function pointer to function address failed to compile" filename="projects/<exe-name>/TrickyTests.cpp" >
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/TrickyTests.cpp" >
<Original>
utility::synchronizing_callback != test.testMethod_uponComplete_arg
</Original>
<Expanded>
1 != 0
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#961 -- Dynamically created sections should all be reported" tags="[.]" filename="projects/<exe-name>/MiscTests.cpp" >
<Section name="Looped section 0" filename="projects/<exe-name>/MiscTests.cpp" >
<OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -1336,17 +1347,6 @@
</Exception>
<OverallResult success="false"/>
</TestCase>
<TestCase name="Demonstrate that a non-const == is not used" tags="[Tricky]" filename="projects/<exe-name>/TrickyTests.cpp" >
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/TrickyTests.cpp" >
<Original>
t == 1u
</Original>
<Expanded>
{?} == 1
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="EndsWith string matcher" tags="[.][failing][matchers]" filename="projects/<exe-name>/MatchersTests.cpp" >
<Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/MatchersTests.cpp" >
<Original>