Skip to content

test: read round trips over type, byte and word order, multiplier and boundary value (CAT-09, WOT-07) - #156

Merged
gavinying merged 1 commit into
v2from
round-trip-matrix
Nov 17, 2026
Merged

gavinying merged 1 commit into
v2from
round-trip-matrix

Conversation

@gavinying

Copy link
Copy Markdown
Collaborator

CAT-09 drops the catalog's per-product simulation check; encoding and decoding are tested once here instead. Also WOT-07 step 2.

  • integration/test_round_trip_matrix.py generates one model with a point per combination: 8 numeric raw types × byte and word order (two orders for single-register types) × multiplier (none, 0.1, -2; integers up to 32 bits) — 54 points.
  • Four boundary passes (lowest, highest, high bit set, asymmetric byte pattern; float extremes and the smallest subnormal). Each pass serves the values with modsim and compares three readers against values encoded with struct: the wire registers (pymodbus, per point), modpoll's --export, and node-wot 0.9.2 reading the node-wot-0.9.2 TD export for the points it supports (16/32-bit integers, 32/64-bit floats, no multiplier).
  • Scaled values are compared as raw × multiplier, exact decimal, which is what modpoll prints.
  • integration.yml installs the pinned node-wot Consumer; in CI the test requires it.
  • A deliberately broken word order makes the test fail. Locally pytest integration: 13 passed in 14 s.

… boundary value (CAT-09, WOT-07)

One generated model holds a point for every combination. Each boundary pass
serves it with modsim and checks the wire registers, modpoll's export and
node-wot 0.9.2 reading the node-wot TD export against values encoded with
struct. This replaces the catalog's per-product simulation check.
@gavinying
gavinying merged commit 168bf4b into v2 Nov 17, 2026
3 checks passed
@gavinying
gavinying deleted the round-trip-matrix branch November 17, 2026 16:14
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.

1 participant