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

Open
opened 2026-08-02 18:32:49 -04:00 by tachikoma · 0 comments
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:32:49 -04:00
tachikoma added the test-coverageblast-radius:medium labels 2026-08-02 18:32:49 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:11 -04:00
Sign in to join this conversation.