Skip to content

Add protocol + NFC host unit tests (new CI gates) and wire up the NFC host bound - #6

Merged
Hoggormino merged 2 commits into
mainfrom
ci-consolidation-b59m16
Sep 24, 2026
Merged

Hoggormino merged 2 commits into
mainfrom
ci-consolidation-b59m16

Conversation

@Hoggormino

@Hoggormino Hoggormino commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Expands host test coverage and puts the TAGTINKER_NFC_HOST_LEN constant to work. Follows the existing OEPL host-test pattern: the real module source is compiled off-device against tiny stub headers and run in CI with just a C compiler — no Flipper SDK, no hardware, and the tests transmit nothing.

Changes

New host test suites + CI gates

  • test/proto_test.c (+ run_proto_test.sh) — covers the pure geometry/layout helpers in protocol/tagtinker_proto.h: the Color 2.6 wire↔glass coordinate transform, page resolution, width/height swap, and profile glass sizing. No stubs needed (the header is plain C).
  • test/nfc_test.c (+ run_nfc_test.sh) — covers tagtinker_nfc_url_host_is() (the URL-host matcher that classifies tag links such as nfc.imagotag.com: scheme stripping, label-boundary check, NULL/empty guards) and the new extractor. Built against a minimal mf_ultralight stub in test/stubs/.
  • .github/workflows/build.yml — two new hard-gate jobs, proto and nfc, mirroring oepl.

Wire up TAGTINKER_NFC_HOST_LEN (previously defined but unreferenced)

  • Adds tagtinker_nfc_url_host() in nfc/tagtinker_nfc.c/.h: copies a tag link's host into a caller buffer, bounded by TAGTINKER_NFC_HOST_LEN. Hosts come off the tag, so the bound limits what is displayed as much as it sizes the buffer. The constant is now used in shipping code.

Docs

  • test/README.md updated for the two new suites and what each covers.

Notes

  • All three suites pass locally (oepl, proto, nfc).
  • The Lint (advisory, non-blocking) check stays red — it's the repo's documented pre-existing clang-format condition, unrelated to this change (see the earlier comment on this PR).
  • Not addressed here: protocol/tagtinker_proto.c functions (tagtinker_crc16, barcode validation, frame builders) — that translation unit includes tagtinker_app.h, so covering it off-device needs an app stub; left as a follow-up and noted in test/README.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LXH25ThRXTiYngLefqYdKi

Hosts come off the tag, so the bound limits what is shown as much as it
sizes a buffer. Defines the constant only; nothing references it yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Owner Author

The failing check is Lint (advisory, non-blocking) (ufbt lint / clang-format). Standing down on it, and here's why it isn't this PR's failure:

  • The lint job is advisory-only and never fails the run by design — see .github/workflows/build.yml (the job comment: "ufbt lint is known to fail on main … Do NOT 'fix' this with ufbt format").
  • The reported violations are in files this PR does not touch — e.g. test/stubs/storage/storage.h:18–19 (typedef enum { FSAM_READ } FsAccessMode;), plus other pre-existing column-aligned code. The one file this PR changes, nfc/tagtinker_nfc.h, isn't in the failure list at all.
  • The FAP sources intentionally use column-aligned macros/struct fields that clang-format rejects; the new TAGTINKER_NFC_HOST_LEN define follows that same intentional alignment.

So this is the known, pre-existing, base-branch-red advisory condition, not a regression from this change. No fix is applied (the repo explicitly forbids ufbt format here), and I've left the advisory check red rather than re-running a deterministically-failing job. The blocking checks and mergeability are unaffected.


Generated by Claude Code

@Hoggormino
Hoggormino marked this pull request as ready for review September 24, 2026 11:48
Adds two off-device host test suites following the existing OEPL pattern
(real module source compiled against tiny stubs, run in CI, no Flipper SDK):

- proto: the pure geometry/layout helpers in protocol/tagtinker_proto.h —
  the Color 2.6 wire<->glass coordinate transform, page resolution, the
  width/height swap, and profile glass sizing.
- nfc: tagtinker_nfc_url_host_is() (the URL-host matcher used to classify
  tag links, e.g. nfc.imagotag.com) plus the new tagtinker_nfc_url_host()
  extractor, compiled against a minimal mf_ultralight stub.

Wires up the previously-unused TAGTINKER_NFC_HOST_LEN: the new
tagtinker_nfc_url_host() copies a tag link's host into a caller buffer,
bounded by that constant. Hosts come off the tag, so the bound limits what
is shown as much as it sizes the buffer.

Both suites run as new hard-gate CI jobs (proto, nfc) in build.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXH25ThRXTiYngLefqYdKi
@Hoggormino Hoggormino changed the title nfc: add TAGTINKER_NFC_HOST_LEN display bound for link hosts Add protocol + NFC host unit tests (new CI gates) and wire up the NFC host bound Sep 24, 2026
@Hoggormino
Hoggormino merged commit f1aa83a into main Sep 24, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants