Skip to content

The tests of the facade, one behaviour each (OIL 41, Testing.md) - #150

Merged
theAndreas merged 2 commits into
mainfrom
facade-tests
Nov 18, 2026
Merged

theAndreas merged 2 commits into
mainfrom
facade-tests

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

What changes for a user

Nothing: only the tests of the facade change.

Why

OIL 41, the chapter Tests: each test file is brought in turn to the rules of docs/Testing.md that review checks. This one is test/MaxMatrixTest.cpp.

What changed

  • Batch has a test file of its own, as it has a header of its own (TS-5). What a test saw inside a block is asserted after the block (TS-10).
  • Split into one behaviour each (TS-9): a test that drew in both modes, the tests of shutdown and of the display test, and the tests of the pace of a shift. The pace tests share a fixture that starts the shift.
  • Expected values written down: a register of every chip is compared with a vector written down, rather than checked in a loop (TS-13, TS-14).
  • A fixture of their own: the tests of a matrix that is not set up yet share one fixture (TS-17). Before, each made its own matrix beside the fixture's, whose check after the test then compared a matrix no test had drawn on.
  • Putting the LEDs back: a test that leaves the LEDs showing something other than the buffer, as one in shutdown, puts them back at its end, with the reason in a comment.

How it was checked

make check passes, with coverage at 100 % of lines, branches and conditions. Flash and RAM of the examples are unchanged.

test/MaxMatrixTest.cpp brought to the rules of Testing.md that review
checks:

- the tests of Batch have a file of their own, test/MaxMatrixBatchTest.cpp,
  as their header has (TS-5); what a test saw inside a block is asserted
  after it (TS-10);
- a test that drew in both modes, those of the shutdown and of the
  display test, and the tests of the pace of a shift are split into one
  behaviour each (TS-9), the pace's on a fixture that starts the shift;
- a register of every chip is compared with a vector written down
  rather than looped over (TS-13, TS-14), through ChipValues() of the
  test support;
- the tests of a matrix not set up share a fixture of their own, rather
  than making one beside the fixture's, whose check after the test then
  compared what no test had drawn (TS-17);
- a test that leaves the LEDs other than the buffer, as one in shutdown,
  puts them back at its end, with the reason.
@theAndreas
theAndreas merged commit c15ce08 into main Nov 18, 2026
17 of 24 checks passed
@theAndreas
theAndreas deleted the facade-tests branch November 18, 2026 15:55
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