Add tests for comparing & stringifying volatile pointers

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

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 );
}