Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Add tests for comparing & stringifying volatile pointers

Commit
03c62cdf2ede08ee759008637adf5d8e5581b77b
Author
Martin Hořeňovský ·
Parents
9a3d68315b92

Files · Download .tar.gz

Changes

 tests/SelfTest/Baselines/automake.sw.approved.txt  |  1 +
 .../Baselines/automake.sw.multi.approved.txt       |  1 +
 tests/SelfTest/Baselines/compact.sw.approved.txt   | 11 +++-
 .../Baselines/compact.sw.multi.approved.txt        | 11 +++-
 tests/SelfTest/Baselines/console.std.approved.txt  |  4 +-
 tests/SelfTest/Baselines/console.sw.approved.txt   | 45 +++++++++++++++-
 .../Baselines/console.sw.multi.approved.txt        | 45 +++++++++++++++-
 tests/SelfTest/Baselines/junit.sw.approved.txt     |  3 +-
 .../SelfTest/Baselines/junit.sw.multi.approved.txt |  3 +-
 tests/SelfTest/Baselines/sonarqube.sw.approved.txt |  1 +
 .../Baselines/sonarqube.sw.multi.approved.txt      |  1 +
 tests/SelfTest/Baselines/tap.sw.approved.txt       | 16 +++++-
 tests/SelfTest/Baselines/tap.sw.multi.approved.txt | 16 +++++-
 tests/SelfTest/Baselines/teamcity.sw.approved.txt  |  2 +
 .../Baselines/teamcity.sw.multi.approved.txt       |  2 +
 tests/SelfTest/Baselines/xml.sw.approved.txt       | 63 +++++++++++++++++++++-
 tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 63 +++++++++++++++++++++-
 tests/SelfTest/UsageTests/Misc.tests.cpp           | 12 +++++
 18 files changed, 282 insertions(+), 18 deletions(-)

diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index 2c608188..4a6886d6 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -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
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index 6ee054f1..b0d30b87 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -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
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 477aa5ff..323da08e 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -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
 
 
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index d6b9f0c3..57b54ce1 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -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
 
 
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index 3b6c86a0..c849d5ee 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -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
 
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 7da948d1..394c4182 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -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
 
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index 27247b0f..018864fe 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -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
 
diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt
index 3c54c89c..42a98dd0 100644
--- a/tests/SelfTest/Baselines/junit.sw.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.approved.txt
@@ -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="&quot;*&quot; ~[!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"/>
diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
index 8d3704c3..5f17b49d 100644
--- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
@@ -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="&quot;*&quot; ~[!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"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
index c7026e37..9f1fbda6 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
@@ -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}"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
index a41578fc..ce9bd534 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
@@ -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}"/>
diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt
index 340bbb1e..699d78c2 100644
--- a/tests/SelfTest/Baselines/tap.sw.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.approved.txt
@@ -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
 
diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
index 132ad3de..6b18914c 100644
--- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
@@ -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
 
diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
index 52c56fb9..853f3d80 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
@@ -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']
diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
index 28ee520b..10e318de 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
@@ -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']
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index fb0eff1a..48b0e260 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -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 &lt; ptr)
+      </Original>
+      <Expanded>
+        !(0 &lt; 0)
+      </Expanded>
+    </Expression>
+    <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
+      <Original>
+        ptr &lt;= ptr
+      </Original>
+      <Expanded>
+        0 &lt;= 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>
diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
index 39fe9c40..f0498aff 100644
--- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
@@ -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 &lt; ptr)
+      </Original>
+      <Expanded>
+        !(0 &lt; 0)
+      </Expanded>
+    </Expression>
+    <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
+      <Original>
+        ptr &lt;= ptr
+      </Original>
+      <Expanded>
+        0 &lt;= 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>
diff --git a/tests/SelfTest/UsageTests/Misc.tests.cpp b/tests/SelfTest/UsageTests/Misc.tests.cpp
index e43f2d84..dec51ab8 100644
--- a/tests/SelfTest/UsageTests/Misc.tests.cpp
+++ b/tests/SelfTest/UsageTests/Misc.tests.cpp
@@ -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 );
+}