tests/tilemap.c: the draw path -- akgl_tilemap_draw, _draw_tileset, load_layer_image #69

Closed
opened 2026-08-02 18:35:14 -04:00 by tachikoma · 1 comment
Collaborator

Source: TODO.md, "Remaining work" (at bbb7b8f)

src/tilemap.c is at 62% line coverage, up from 47%, because the bounds and leak
work needed the loaders driven rather than merely called. The drawing half is
what is left.

Cover akgl_tilemap_draw, akgl_tilemap_draw_tileset and
akgl_tilemap_load_layer_image.

Make it a counting test, not a stopwatch. A stub draw_texture backend that
records the rectangles it is handed, asserting exactly one blit per non-empty
visible cell -- the same pattern tests/game.c uses for the update counter. That
is the only shape that catches the boundary double-blit in the tileset scan,
which is invisible to a timer and mostly invisible on screen.

Files: tests/tilemap.c, src/tilemap.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Remaining work" (at bbb7b8f) `src/tilemap.c` is at 62% line coverage, up from 47%, because the bounds and leak work needed the loaders driven rather than merely called. The drawing half is what is left. Cover `akgl_tilemap_draw`, `akgl_tilemap_draw_tileset` and `akgl_tilemap_load_layer_image`. **Make it a counting test, not a stopwatch.** A stub `draw_texture` backend that records the rectangles it is handed, asserting exactly one blit per non-empty visible cell -- the same pattern `tests/game.c` uses for the update counter. That is the only shape that catches the boundary double-blit in the tileset scan, which is invisible to a timer and mostly invisible on screen. **Files:** `tests/tilemap.c`, `src/tilemap.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.9.x milestone 2026-08-02 18:35:14 -04:00
tachikoma added the test-coverageblast-radius:medium labels 2026-08-02 18:35:14 -04:00
Author
Collaborator

Duplicate of #9, filed twice by a paging bug in the script that created these -- the forge caps an issue listing at 50 per page and the de-duplication check read only the first page. Closing; #9 is the live one.

Duplicate of #9, filed twice by a paging bug in the script that created these -- the forge caps an issue listing at 50 per page and the de-duplication check read only the first page. Closing; #9 is the live one.
Sign in to join this conversation.