Repository navigation
Pin first-match location lookups and occupied-location copies - #85
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on CI run 43819531064)
Judgment note: src/tests.cpp Test 89 — the grid outlives nothing it dereferences ( This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/tests.cppand registered inmain()(Stage B, unit-test expansion onGrid):Grid::getLocation,Grid::getLocationByCoordinates, andGrid::addEntityToLocationuse the first match ingetLocations()order, whileGrid::removeLocationremoves every location with the id (and detaches the entity placed there).Grid::addLocationon a location that already holds entities copies theEntity*pointers, so the grid counts the entity and reports it present, but no grid id is set; afterwards the original's and the copy's vectors are independent.README.mdgains two short paragraphs describing the same behaviour. No production code is changed.No tracking issue: the open-issue backlog was empty at triage, so this gap was found during a coverage sweep comparing the public methods of
Gridagainst the existing tests.Test plan
makecompiles the suite locally with the two new tests.Library tests (make + CMake)runsrun_tests.shandrun_tests_asan.shgreen (local execution of the test binary is blocked in this sandbox, so CI is the anchor).This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson