bug: fix Results debug assertion #7

Closed
opened 2026-07-30 16:23:34 +01:00 by mcp · 0 comments
Collaborator

Background

Results::set() asserts against grid_[x + y * length_], but Results has no grid_ member. Release builds hide the expression through NDEBUG; Debug compilation fails.

The assertion should check the output string or otherwise express the intended invariant using members that exist.

Proposed work

  • Correct the assertion to inspect the rendered output buffer.
  • Review the intended duplicate-write invariant.
  • Add a Debug-build test that renders a valid solution.

Acceptance criteria

  • The project builds in Debug mode.
  • Rendering a valid solution passes assertions.
  • A deliberately conflicting render is covered if practical.
  • The fix is committed separately from performance work.

Reference

  • main.cc:82-87
## Background `Results::set()` asserts against `grid_[x + y * length_]`, but `Results` has no `grid_` member. Release builds hide the expression through `NDEBUG`; Debug compilation fails. The assertion should check the output string or otherwise express the intended invariant using members that exist. ## Proposed work - Correct the assertion to inspect the rendered output buffer. - Review the intended duplicate-write invariant. - Add a Debug-build test that renders a valid solution. ## Acceptance criteria - The project builds in Debug mode. - Rendering a valid solution passes assertions. - A deliberately conflicting render is covered if practical. - The fix is committed separately from performance work. ## Reference - `main.cc:82-87`
mcp closed this issue 2026-07-30 16:47:26 +01:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mgrettondann/partridge-cpp#7