Add tests for comparing & stringifying volatile pointers

This commit is contained in:
Martin Hořeňovský committed 2025-08-08 00:02:33 +02:00
1 parent 9a3d68315b
commit 03c62cdf2e
18 files changed
+282 -18

No files matched your search

+12
View File
@@ -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 );
}