Files
wlgol/tests/test_grid.c
T
arek 7874a5f7c6 feat: implement keyboard and mouse input, pattern placement, and HiDPI scaling
Add configurable key bindings (TOML), modifier-aware dispatch, mouse-driven
pattern placement with preview and rotation, cell grid storage/rendering,
and fractional/integer HiDPI scaling. Archive the input-and-placement change
and sync its specs to main specs.

Tests: Hashtable, Config, Grid, Pattern (4/4 pass).
2026-11-08 14:46:04 +01:00

25 lines
547 B
C

#include <assert.h>
#include <stdio.h>
#include "grid.h"
int main(void) {
grid_t g;
grid_init(&g, 4, 4);
assert(grid_get(&g, 0, 0) == 0);
grid_set(&g, 1, 2, 1);
assert(grid_get(&g, 1, 2) == 1);
assert(grid_get(&g, -1, 0) == 0);
assert(grid_get(&g, 4, 4) == 0);
grid_set(&g, 0, 0, 1);
grid_resize(&g, 6, 2);
assert(grid_get(&g, 0, 0) == 1);
assert(grid_get(&g, 1, 2) == 0);
grid_clear(&g);
assert(grid_get(&g, 0, 0) == 0);
grid_free(&g);
printf("grid tests passed\n");
return 0;
}