CNA-BUG-205: SDL_Renderer_ClearOptions_Audit encodes Clear semantics that no longer exist and catches the wrong exception type, so it cannot pass at this snapshot
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
Clear now throws System::InvalidOperationException for any missing depth or stencil aspect, but the test expects Stencil-only clears not to throw and catches only std::runtime_error, which that exception does not derive from.
- Identifier
CNA-BUG-205- Category
- Bug
- Subsystem
- Testing & evidence
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- modules/renderers/sdl-renderer/examples/sdlrenderer_clearoptions_audit_test.cpp (CTest SDL_Renderer_ClearOptions_Audit)
Expected behaviour
A registered test's expectations should match the current contract. GraphicsDevice.cpp's Clear(ClearOptions, ...) computes the available aspects (GetDefaultClearOptions, from HasRealBackBufferDepthBuffer/StencilBuffer) and throws System::InvalidOperationException ("Cannot clear depth or stencil because the device does not have an active depth or stencil buffer") for a requested aspect that is missing, as XNA does.
Actual behaviour at TARGET
SDL_RENDERER reports SupportsDepthStencil() == false, so both aspects are missing. The test's header still describes the older behaviour (stencil discarded, depth routed to a throwing renderer hook), and it asserts !ClearThrows(Stencil) and !ClearThrows(Target | Stencil). Its ClearThrows helper catches const std::runtime_error& only, while System::InvalidOperationException derives from System::Exception : std::exception (Sharp Runtime, read at next 41b918c9 and at the CI-pinned f23ded28). By reading, the first depth check lets the exception escape Draw; Game::Run logs and rethrows it and main terminates, so the test fails.
Source locations
modules/renderers/sdl-renderer/examples/sdlrenderer_clearoptions_audit_test.cpp— ClearThrows helper, the DepthBuffer and Stencil checks and the header commentmodules/graphics/src/Xna/GraphicsDevice.cpp— GraphicsDevice::Clear missing-aspect InvalidOperationException and GetDefaultClearOptionsmodules/renderers/sdl-renderer/include/CNA/Internal/Renderers/SdlRenderer/SdlRenderer.hpp— SupportsDepthStencil() returns false
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. The Sharp Runtime revision is not pinned by TARGET; both revisions read define System::Exception on std::exception. No workflow runs this test (CNA-VGAP-027), which is how the drift went unnoticed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
This is the only ClearOptions test on SDL_RENDERER.
Regression test
Update the test: catch System::InvalidOperationException (or std::exception) and expect every combination that includes DepthBuffer or Stencil to throw.
Blast radius
The SDL_RENDERER test suite's result; runtime Clear behaviour is correct.
Workaround
No workaround is known.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Known issues
- Bug index