Host-side unit tests for the watchapp logic #68
Labels
No labels
area:companion
area:docs
area:shared
area:tooling
area:watchapp
blocker
kind:chore
kind:feature
kind:spike
kind:test
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#58 Field value store and page descriptor model
robert/PedalPebble
Reference
robert/PedalPebble#68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Test the C. Every test issue in the plan targets the JVM companion - the watchapp, which is the half written in C, has none.
The field store, the formatter table, the staleness rule, the template geometry and the descriptor packing are all pure functions over plain data. Compiled for the host with a small harness they test without an emulator, a watch or a phone.
Acceptance criteria
--, zero-is-not-absentFieldIdformats, in metric and imperial, including its unavailable renderingemery,gabbroorbasalt- the assertion that makes the deferred round work in #62 safe to do laterFiles
watchapp/test/watchapp/test/stubs/Notes
See D34. Keeping the geometry pure - taking bounds in, giving rects out - is what makes this possible; that constraint is worth honouring in #59 for its own sake.
Update — 2026-09-02: two more things to test on the host
rotate — asserted against fixture slices on all three geometries. Pure integer functions, no SDK
as its type's sentinel renders
--; a constant value under changed-keys-only updates doesneither
PR #82 lands a first, partial round of this issue's host test harness, scoped to what
currently exists in
watchapp/src/c/(fields.c/page.c from #58/PR #81). Not closing this issue —several acceptance criteria below depend on work that hasn't landed yet.
Satisfied by #82
touched (
watchapp/tests/stubs/pebble.h— thepersist_*calls in page.c)watchapp/tests/harness.h, ~90 lines)--, zero-is-not-absentFieldIdformats and renders its unavailable text — metric only.Imperial is blocked on #44 (not yet built); not faked here.
actual group-heartbeat model PR #81 built (D44: stale vs unavailable are different states, a
group heartbeat ages a whole group, not a single key)
ids — mirrors #61's future validation at the level this API exists at today. ("wrong slot
counts" doesn't apply to
page_descriptor_unpack's fixed-size signature; that's a concern forwhatever decodes a variable-length CONFIG_PAGES payload into it, once #61 exists.)
watchapp/tests/CMakeLists.txtnow exists, sofast-lane.yml'shost-c-testsjob's skip guard finds it and will build+run it once a runner is registered.unavailable — from the 2026-09-02 update
Still blocked — not built here, not faked
— blocked on #60 (page carousel), not yet built.
page_has_live_field(the primitive #60will consume) is tested in #82 as far as it currently goes.
(template geometry), not yet built
(map projection), not yet built
A future PR should extend
watchapp/tests/(test_fields.c, test_page.c, plus new test_*.c files)rather than rebuilding the harness — the CMakeLists.txt, harness.h and stubs/ are all meant to be
shared across whichever of #59/#60/#42/#44 lands next.
https://claude.ai/code/session_01DAoXbRmJUf2uxNYBfdAXPt