diff options
| author | Martin Hořeňovský | 2025-08-08 00:02:33 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-08-08 00:02:33 +0200 |
| commit | 03c62cdf2ede08ee759008637adf5d8e5581b77b (patch) | |
| tree | 9ffddb8103194e8393b3a5acbccc59967b48991d /tests/SelfTest/UsageTests/Misc.tests.cpp | |
| parent | 9a3d68315b92ea00dc7f85966774ffea57432cc0 (diff) | |
| download | catch3-03c62cdf2ede08ee759008637adf5d8e5581b77b.tar.gz | |
Add tests for comparing & stringifying volatile pointers
Diffstat (limited to 'tests/SelfTest/UsageTests/Misc.tests.cpp')
| -rw-r--r-- | tests/SelfTest/UsageTests/Misc.tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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 ); +} |