mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Add tests for comparing & stringifying volatile pointers
This commit is contained in:
		| @@ -122,6 +122,7 @@ Nor would this | ||||
| :test-result: PASS Combining templated and concrete matchers | ||||
| :test-result: PASS Combining templated matchers | ||||
| :test-result: PASS Commas in various macros are allowed | ||||
| :test-result: PASS Comparing (and stringifying) volatile pointers works | ||||
| :test-result: PASS Comparing function pointers | ||||
| :test-result: PASS Comparison ops | ||||
| :test-result: PASS Comparison with explicitly convertible types | ||||
|   | ||||
| @@ -120,6 +120,7 @@ | ||||
| :test-result: PASS Combining templated and concrete matchers | ||||
| :test-result: PASS Combining templated matchers | ||||
| :test-result: PASS Commas in various macros are allowed | ||||
| :test-result: PASS Comparing (and stringifying) volatile pointers works | ||||
| :test-result: PASS Comparing function pointers | ||||
| :test-result: PASS Comparison ops | ||||
| :test-result: PASS Comparison with explicitly convertible types | ||||
|   | ||||
| @@ -483,6 +483,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in | ||||
| Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| Tricky.tests.cpp:<line number>: passed: true | ||||
| Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr) for: !0 | ||||
| Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0 | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0) | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0) | ||||
| Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0 | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0) | ||||
| Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0 | ||||
| Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits> | ||||
| Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits> | ||||
| RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{} == SimplePcg32{} for: {?} == {?} | ||||
| @@ -2877,7 +2884,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0 | ||||
| InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0 | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| test cases:  434 |  316 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected | ||||
| test cases:  435 |  317 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -481,6 +481,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in | ||||
| Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| Tricky.tests.cpp:<line number>: passed: true | ||||
| Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr) for: !0 | ||||
| Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0 | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0) | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0) | ||||
| Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0 | ||||
| Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0) | ||||
| Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0 | ||||
| Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits> | ||||
| Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits> | ||||
| RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{} == SimplePcg32{} for: {?} == {?} | ||||
| @@ -2866,7 +2873,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0 | ||||
| InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0 | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| test cases:  434 |  316 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected | ||||
| test cases:  435 |  317 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1719,6 +1719,6 @@ due to unexpected exception with message: | ||||
|   Why would you throw a std::string? | ||||
|  | ||||
| =============================================================================== | ||||
| test cases:  434 |  334 passed |  76 failed | 7 skipped | 17 failed as expected | ||||
| assertions: 2271 | 2094 passed | 136 failed | 41 failed as expected | ||||
| test cases:  435 |  335 passed |  76 failed | 7 skipped | 17 failed as expected | ||||
| assertions: 2278 | 2101 passed | 136 failed | 41 failed as expected | ||||
|  | ||||
|   | ||||
| @@ -3555,6 +3555,47 @@ Tricky.tests.cpp:<line number>: PASSED: | ||||
| with expansion: | ||||
|   { 1, 2 } == { 1, 2 } | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| Comparing (and stringifying) volatile pointers works | ||||
| ------------------------------------------------------------------------------- | ||||
| Misc.tests.cpp:<line number> | ||||
| ............................................................................... | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr ) | ||||
| with expansion: | ||||
|   !0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr == ptr ) | ||||
| with expansion: | ||||
|   0 == 0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr != ptr ) | ||||
| with expansion: | ||||
|   !(0 != 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr < ptr ) | ||||
| with expansion: | ||||
|   !(0 < 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr <= ptr ) | ||||
| with expansion: | ||||
|   0 <= 0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr > ptr ) | ||||
| with expansion: | ||||
|   !(0 > 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr >= ptr ) | ||||
| with expansion: | ||||
|   0 >= 0 | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| Comparing function pointers | ||||
| ------------------------------------------------------------------------------- | ||||
| @@ -19226,6 +19267,6 @@ Misc.tests.cpp:<line number> | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|  | ||||
| =============================================================================== | ||||
| test cases:  434 |  316 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected | ||||
| test cases:  435 |  317 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected | ||||
|  | ||||
|   | ||||
| @@ -3553,6 +3553,47 @@ Tricky.tests.cpp:<line number>: PASSED: | ||||
| with expansion: | ||||
|   { 1, 2 } == { 1, 2 } | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| Comparing (and stringifying) volatile pointers works | ||||
| ------------------------------------------------------------------------------- | ||||
| Misc.tests.cpp:<line number> | ||||
| ............................................................................... | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr ) | ||||
| with expansion: | ||||
|   !0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr == ptr ) | ||||
| with expansion: | ||||
|   0 == 0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr != ptr ) | ||||
| with expansion: | ||||
|   !(0 != 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr < ptr ) | ||||
| with expansion: | ||||
|   !(0 < 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr <= ptr ) | ||||
| with expansion: | ||||
|   0 <= 0 | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE_FALSE( ptr > ptr ) | ||||
| with expansion: | ||||
|   !(0 > 0) | ||||
|  | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|   REQUIRE( ptr >= ptr ) | ||||
| with expansion: | ||||
|   0 >= 0 | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| Comparing function pointers | ||||
| ------------------------------------------------------------------------------- | ||||
| @@ -19215,6 +19256,6 @@ Misc.tests.cpp:<line number> | ||||
| Misc.tests.cpp:<line number>: PASSED: | ||||
|  | ||||
| =============================================================================== | ||||
| test cases:  434 |  316 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected | ||||
| test cases:  435 |  317 passed |  95 failed | 6 skipped | 17 failed as expected | ||||
| assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <testsuitesloose text artifact | ||||
| > | ||||
|   <testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2304" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|   <testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|     <properties> | ||||
|       <property name="random-seed" value="1"/> | ||||
|       <property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/> | ||||
| @@ -488,6 +488,7 @@ at Message.tests.cpp:<line number> | ||||
|     <testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/> | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <testsuites> | ||||
|   <testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2304" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|   <testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|     <properties> | ||||
|       <property name="random-seed" value="1"/> | ||||
|       <property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/> | ||||
| @@ -487,6 +487,7 @@ at Message.tests.cpp:<line number> | ||||
|     <testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/> | ||||
|     <testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/> | ||||
|   | ||||
| @@ -1934,6 +1934,7 @@ at Misc.tests.cpp:<line number> | ||||
|     <testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/> | ||||
|     <testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/> | ||||
|     <testCase name="An empty test with no assertions" duration="{duration}"/> | ||||
|     <testCase name="Comparing (and stringifying) volatile pointers works" duration="{duration}"/> | ||||
|     <testCase name="Factorials are computed" duration="{duration}"/> | ||||
|     <testCase name="ManuallyRegistered" duration="{duration}"/> | ||||
|     <testCase name="Nice descriptive name" duration="{duration}"/> | ||||
|   | ||||
| @@ -1933,6 +1933,7 @@ at Misc.tests.cpp:<line number> | ||||
|     <testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/> | ||||
|     <testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/> | ||||
|     <testCase name="An empty test with no assertions" duration="{duration}"/> | ||||
|     <testCase name="Comparing (and stringifying) volatile pointers works" duration="{duration}"/> | ||||
|     <testCase name="Factorials are computed" duration="{duration}"/> | ||||
|     <testCase name="ManuallyRegistered" duration="{duration}"/> | ||||
|     <testCase name="Nice descriptive name" duration="{duration}"/> | ||||
|   | ||||
| @@ -866,6 +866,20 @@ ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 | ||||
| ok {test-number} - true | ||||
| # Commas in various macros are allowed | ||||
| ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr) for: !0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr == ptr for: 0 == 0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr != ptr) for: !(0 != 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr < ptr) for: !(0 < 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr <= ptr for: 0 <= 0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr > ptr) for: !(0 > 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr >= ptr for: 0 >= 0 | ||||
| # Comparing function pointers | ||||
| ok {test-number} - a for: 0x<hex digits> | ||||
| # Comparing function pointers | ||||
| @@ -4605,5 +4619,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 | ||||
| ok {test-number} - | ||||
| # xmlentitycheck | ||||
| ok {test-number} - | ||||
| 1..2304 | ||||
| 1..2311 | ||||
|  | ||||
|   | ||||
| @@ -864,6 +864,20 @@ ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 | ||||
| ok {test-number} - true | ||||
| # Commas in various macros are allowed | ||||
| ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 } | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr) for: !0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr == ptr for: 0 == 0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr != ptr) for: !(0 != 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr < ptr) for: !(0 < 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr <= ptr for: 0 <= 0 | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - !(ptr > ptr) for: !(0 > 0) | ||||
| # Comparing (and stringifying) volatile pointers works | ||||
| ok {test-number} - ptr >= ptr for: 0 >= 0 | ||||
| # Comparing function pointers | ||||
| ok {test-number} - a for: 0x<hex digits> | ||||
| # Comparing function pointers | ||||
| @@ -4594,5 +4608,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 | ||||
| ok {test-number} - | ||||
| # xmlentitycheck | ||||
| ok {test-number} - | ||||
| 1..2304 | ||||
| 1..2311 | ||||
|  | ||||
|   | ||||
| @@ -285,6 +285,8 @@ | ||||
| ##teamcity[testFinished name='Combining templated matchers' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Commas in various macros are allowed'] | ||||
| ##teamcity[testFinished name='Commas in various macros are allowed' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparing (and stringifying) volatile pointers works'] | ||||
| ##teamcity[testFinished name='Comparing (and stringifying) volatile pointers works' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparing function pointers'] | ||||
| ##teamcity[testFinished name='Comparing function pointers' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparison ops'] | ||||
|   | ||||
| @@ -285,6 +285,8 @@ | ||||
| ##teamcity[testFinished name='Combining templated matchers' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Commas in various macros are allowed'] | ||||
| ##teamcity[testFinished name='Commas in various macros are allowed' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparing (and stringifying) volatile pointers works'] | ||||
| ##teamcity[testFinished name='Comparing (and stringifying) volatile pointers works' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparing function pointers'] | ||||
| ##teamcity[testFinished name='Comparing function pointers' duration="{duration}"] | ||||
| ##teamcity[testStarted name='Comparison ops'] | ||||
|   | ||||
| @@ -3881,6 +3881,65 @@ C | ||||
|     </Expression> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <TestCase name="Comparing (and stringifying) volatile pointers works" tags="[volatile]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr == ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 == 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr != ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 != 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr < ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 < 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr <= ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 <= 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr > ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 > 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr >= ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 >= 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > | ||||
|       <Original> | ||||
| @@ -22227,6 +22286,6 @@ Approx( -1.95996398454005449 ) | ||||
|     </Section> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <OverallResults successes="2094" failures="157" expectedFailures="41" skips="12"/> | ||||
|   <OverallResultsCases successes="316" failures="95" expectedFailures="17" skips="6"/> | ||||
|   <OverallResults successes="2101" failures="157" expectedFailures="41" skips="12"/> | ||||
|   <OverallResultsCases successes="317" failures="95" expectedFailures="17" skips="6"/> | ||||
| </Catch2TestRun> | ||||
|   | ||||
| @@ -3881,6 +3881,65 @@ C | ||||
|     </Expression> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <TestCase name="Comparing (and stringifying) volatile pointers works" tags="[volatile]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr == ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 == 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr != ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 != 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr < ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 < 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr <= ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 <= 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         !(ptr > ptr) | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         !(0 > 0) | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > | ||||
|       <Original> | ||||
|         ptr >= ptr | ||||
|       </Original> | ||||
|       <Expanded> | ||||
|         0 >= 0 | ||||
|       </Expanded> | ||||
|     </Expression> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > | ||||
|     <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > | ||||
|       <Original> | ||||
| @@ -22226,6 +22285,6 @@ Approx( -1.95996398454005449 ) | ||||
|     </Section> | ||||
|     <OverallResult success="true" skips="0"/> | ||||
|   </TestCase> | ||||
|   <OverallResults successes="2094" failures="157" expectedFailures="41" skips="12"/> | ||||
|   <OverallResultsCases successes="316" failures="95" expectedFailures="17" skips="6"/> | ||||
|   <OverallResults successes="2101" failures="157" expectedFailures="41" skips="12"/> | ||||
|   <OverallResultsCases successes="317" failures="95" expectedFailures="17" skips="6"/> | ||||
| </Catch2TestRun> | ||||
|   | ||||
| @@ -562,3 +562,15 @@ TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][! | ||||
| } | ||||
|  | ||||
| #endif // _MSC_VER | ||||
|  | ||||
| TEST_CASE( "Comparing (and stringifying) volatile pointers works", | ||||
|            "[volatile]" ) { | ||||
|     volatile int* ptr = nullptr; | ||||
|     REQUIRE_FALSE( ptr ); | ||||
|     REQUIRE( ptr == ptr ); | ||||
|     REQUIRE_FALSE( ptr != ptr ); | ||||
|     REQUIRE_FALSE( ptr < ptr ); | ||||
|     REQUIRE( ptr <= ptr ); | ||||
|     REQUIRE_FALSE( ptr > ptr ); | ||||
|     REQUIRE( ptr >= ptr ); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský