Skip to content

Commit 03c62cd

Browse files
committed
Add tests for comparing & stringifying volatile pointers
1 parent 9a3d683 commit 03c62cd

18 files changed

+282
-18
lines changed

tests/SelfTest/Baselines/automake.sw.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Nor would this
122122
:test-result: PASS Combining templated and concrete matchers
123123
:test-result: PASS Combining templated matchers
124124
:test-result: PASS Commas in various macros are allowed
125+
:test-result: PASS Comparing (and stringifying) volatile pointers works
125126
:test-result: PASS Comparing function pointers
126127
:test-result: PASS Comparison ops
127128
:test-result: PASS Comparison with explicitly convertible types

tests/SelfTest/Baselines/automake.sw.multi.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
:test-result: PASS Combining templated and concrete matchers
121121
:test-result: PASS Combining templated matchers
122122
:test-result: PASS Commas in various macros are allowed
123+
:test-result: PASS Comparing (and stringifying) volatile pointers works
123124
:test-result: PASS Comparing function pointers
124125
:test-result: PASS Comparison ops
125126
:test-result: PASS Comparison with explicitly convertible types

tests/SelfTest/Baselines/compact.sw.approved.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in
483483
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
484484
Tricky.tests.cpp:<line number>: passed: true
485485
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
486+
Misc.tests.cpp:<line number>: passed: !(ptr) for: !0
487+
Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0
488+
Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0)
489+
Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0)
490+
Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0
491+
Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0)
492+
Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0
486493
Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits>
487494
Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits>
488495
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
28772884
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
28782885
Misc.tests.cpp:<line number>: passed:
28792886
Misc.tests.cpp:<line number>: passed:
2880-
test cases: 434 | 316 passed | 95 failed | 6 skipped | 17 failed as expected
2881-
assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected
2887+
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
2888+
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
28822889

28832890

tests/SelfTest/Baselines/compact.sw.multi.approved.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in
481481
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
482482
Tricky.tests.cpp:<line number>: passed: true
483483
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
484+
Misc.tests.cpp:<line number>: passed: !(ptr) for: !0
485+
Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0
486+
Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0)
487+
Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0)
488+
Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0
489+
Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0)
490+
Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0
484491
Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits>
485492
Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits>
486493
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
28662873
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
28672874
Misc.tests.cpp:<line number>: passed:
28682875
Misc.tests.cpp:<line number>: passed:
2869-
test cases: 434 | 316 passed | 95 failed | 6 skipped | 17 failed as expected
2870-
assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected
2876+
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
2877+
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
28712878

28722879

tests/SelfTest/Baselines/console.std.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,6 @@ due to unexpected exception with message:
17191719
Why would you throw a std::string?
17201720

17211721
===============================================================================
1722-
test cases: 434 | 334 passed | 76 failed | 7 skipped | 17 failed as expected
1723-
assertions: 2271 | 2094 passed | 136 failed | 41 failed as expected
1722+
test cases: 435 | 335 passed | 76 failed | 7 skipped | 17 failed as expected
1723+
assertions: 2278 | 2101 passed | 136 failed | 41 failed as expected
17241724

tests/SelfTest/Baselines/console.sw.approved.txt

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,6 +3555,47 @@ Tricky.tests.cpp:<line number>: PASSED:
35553555
with expansion:
35563556
{ 1, 2 } == { 1, 2 }
35573557

3558+
-------------------------------------------------------------------------------
3559+
Comparing (and stringifying) volatile pointers works
3560+
-------------------------------------------------------------------------------
3561+
Misc.tests.cpp:<line number>
3562+
...............................................................................
3563+
3564+
Misc.tests.cpp:<line number>: PASSED:
3565+
REQUIRE_FALSE( ptr )
3566+
with expansion:
3567+
!0
3568+
3569+
Misc.tests.cpp:<line number>: PASSED:
3570+
REQUIRE( ptr == ptr )
3571+
with expansion:
3572+
0 == 0
3573+
3574+
Misc.tests.cpp:<line number>: PASSED:
3575+
REQUIRE_FALSE( ptr != ptr )
3576+
with expansion:
3577+
!(0 != 0)
3578+
3579+
Misc.tests.cpp:<line number>: PASSED:
3580+
REQUIRE_FALSE( ptr < ptr )
3581+
with expansion:
3582+
!(0 < 0)
3583+
3584+
Misc.tests.cpp:<line number>: PASSED:
3585+
REQUIRE( ptr <= ptr )
3586+
with expansion:
3587+
0 <= 0
3588+
3589+
Misc.tests.cpp:<line number>: PASSED:
3590+
REQUIRE_FALSE( ptr > ptr )
3591+
with expansion:
3592+
!(0 > 0)
3593+
3594+
Misc.tests.cpp:<line number>: PASSED:
3595+
REQUIRE( ptr >= ptr )
3596+
with expansion:
3597+
0 >= 0
3598+
35583599
-------------------------------------------------------------------------------
35593600
Comparing function pointers
35603601
-------------------------------------------------------------------------------
@@ -19226,6 +19267,6 @@ Misc.tests.cpp:<line number>
1922619267
Misc.tests.cpp:<line number>: PASSED:
1922719268

1922819269
===============================================================================
19229-
test cases: 434 | 316 passed | 95 failed | 6 skipped | 17 failed as expected
19230-
assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected
19270+
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
19271+
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
1923119272

tests/SelfTest/Baselines/console.sw.multi.approved.txt

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,6 +3553,47 @@ Tricky.tests.cpp:<line number>: PASSED:
35533553
with expansion:
35543554
{ 1, 2 } == { 1, 2 }
35553555

3556+
-------------------------------------------------------------------------------
3557+
Comparing (and stringifying) volatile pointers works
3558+
-------------------------------------------------------------------------------
3559+
Misc.tests.cpp:<line number>
3560+
...............................................................................
3561+
3562+
Misc.tests.cpp:<line number>: PASSED:
3563+
REQUIRE_FALSE( ptr )
3564+
with expansion:
3565+
!0
3566+
3567+
Misc.tests.cpp:<line number>: PASSED:
3568+
REQUIRE( ptr == ptr )
3569+
with expansion:
3570+
0 == 0
3571+
3572+
Misc.tests.cpp:<line number>: PASSED:
3573+
REQUIRE_FALSE( ptr != ptr )
3574+
with expansion:
3575+
!(0 != 0)
3576+
3577+
Misc.tests.cpp:<line number>: PASSED:
3578+
REQUIRE_FALSE( ptr < ptr )
3579+
with expansion:
3580+
!(0 < 0)
3581+
3582+
Misc.tests.cpp:<line number>: PASSED:
3583+
REQUIRE( ptr <= ptr )
3584+
with expansion:
3585+
0 <= 0
3586+
3587+
Misc.tests.cpp:<line number>: PASSED:
3588+
REQUIRE_FALSE( ptr > ptr )
3589+
with expansion:
3590+
!(0 > 0)
3591+
3592+
Misc.tests.cpp:<line number>: PASSED:
3593+
REQUIRE( ptr >= ptr )
3594+
with expansion:
3595+
0 >= 0
3596+
35563597
-------------------------------------------------------------------------------
35573598
Comparing function pointers
35583599
-------------------------------------------------------------------------------
@@ -19215,6 +19256,6 @@ Misc.tests.cpp:<line number>
1921519256
Misc.tests.cpp:<line number>: PASSED:
1921619257

1921719258
===============================================================================
19218-
test cases: 434 | 316 passed | 95 failed | 6 skipped | 17 failed as expected
19219-
assertions: 2292 | 2094 passed | 157 failed | 41 failed as expected
19259+
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
19260+
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
1922019261

tests/SelfTest/Baselines/junit.sw.approved.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuitesloose text artifact
33
>
4-
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2304" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
4+
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
55
<properties>
66
<property name="random-seed" value="1"/>
77
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -488,6 +488,7 @@ at Message.tests.cpp:<line number>
488488
<testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/>
489489
<testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/>
490490
<testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/>
491+
<testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/>
491492
<testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/>
492493
<testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/>
493494
<testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/>

tests/SelfTest/Baselines/junit.sw.multi.approved.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuites>
3-
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2304" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
3+
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
44
<properties>
55
<property name="random-seed" value="1"/>
66
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -487,6 +487,7 @@ at Message.tests.cpp:<line number>
487487
<testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/>
488488
<testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/>
489489
<testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/>
490+
<testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/>
490491
<testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/>
491492
<testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/>
492493
<testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/>

tests/SelfTest/Baselines/sonarqube.sw.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,7 @@ at Misc.tests.cpp:<line number>
19341934
<testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/>
19351935
<testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/>
19361936
<testCase name="An empty test with no assertions" duration="{duration}"/>
1937+
<testCase name="Comparing (and stringifying) volatile pointers works" duration="{duration}"/>
19371938
<testCase name="Factorials are computed" duration="{duration}"/>
19381939
<testCase name="ManuallyRegistered" duration="{duration}"/>
19391940
<testCase name="Nice descriptive name" duration="{duration}"/>

0 commit comments

Comments
 (0)