Skip to content

OIL 41, chapter Functions: the rest in the host code - #128

Merged
theAndreas merged 2 commits into
mainfrom
oil-41-functions-rest
Nov 17, 2026
Merged

theAndreas merged 2 commits into
mainfrom
oil-41-functions-rest

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

Nothing changes for a sketch. DocuPictures --write now says so when it cannot write a picture, where it failed without a word before; everything else behaves as before. The library is untouched, and every example has the same flash and RAM as on main.

The last pull request of the review of the chapter Functions in OIL item 41: the single findings left in the simulator, the control program and DocuPictures.

  • FN-1: printing the panel at the end of a run and comparing it with the expected one were one function, and so were writing the pictures and checking them; each is two now.
  • FN-14: the check whether a wiring shows the panel upright returns at the first dot that differs instead of setting a flag, and the search for the name MD_MAX72XX gives a wiring is a function of its own.
  • FN-7, FN-9, FN-11, FN-15: a struct of 24 bytes by const& and a point of 8 by value; a few helpers constexpr; a function that writes the frame not const; the simulator's wiring, which always exists, held by std::reference_wrapper rather than a pointer.
  • FN-13: DocuPictures read files with a copy of the simulator's file reader, and uses it now.
  • FN-16: the pairs of parameters that clang-tidy cannot see are left as they are, as a test fails on a swap of each; the list and the tests are in OIL.md. To make that hold for the web host's status and content type, the web test now checks the page's as well.

Checked:

  • make check passes: lint, clang-tidy, every host and AVR test, coverage at 100 % of lines, branches and conditions.
  • DocuPictures --write into an empty folder writes the pictures in docu/ byte for byte, --check of that folder passes, and --write into a folder that does not exist reports every picture.
  • The control program's window builds; it was not clicked through, and its Windows half was not compiled, as there is no MinGW in the dev container.
  • Not run on hardware; the library does not change.

Printing the panel at the end of a run and comparing it with --expect are
two functions (FN-1), as are writing the pictures of DocuPictures and
checking them; a picture it cannot write is reported now. IsUpright()
returns at the first dot that differs, and the name MD_MAX72XX gives a
wiring is found by a function of its own (FN-14). DocuSvg takes its paint
and font by const&, the control program a wxPoint by value (FN-7); a few
helpers are constexpr (FN-9); the simulator's panel holds its wiring by
std::reference_wrapper (FN-15); SimulatorAvr::TakeByte() is not const,
as it writes the frame (FN-11); DocuPictures reads a file through
SimulatorFile (FN-13).

The swappable pairs clang-tidy cannot see are left, as a test fails on a
swap of each; the web test now pins the page's status and type as well.
The library and its sizes do not change.
@theAndreas
theAndreas merged commit b197635 into main Nov 17, 2026
12 checks passed
@theAndreas
theAndreas deleted the oil-41-functions-rest branch November 17, 2026 15:32
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