|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Test-access surface for reflow internal helpers (MC/DC). More...
Go to the source code of this file.
Functions | |
| bool | priv_reflow_internal_is_indent_tag (uint8_t tag) |
Return true iff tag is a tag that introduces / removes a block-level indent (currently <li> and <blockquote>). | |
| bool | priv_reflow_internal_right_overflow_break (int32_t cursor_x, int32_t advance, int32_t right_limit, uint8_t line_has_content) |
| Decide whether a glyph emission would overflow the right margin AND the current line already has content. | |
| bool | priv_reflow_internal_xhtml_invalid (const void *xhtml_buf, size_t xhtml_len) |
| Decide whether the cached XHTML buffer pointer/length pair is unusable for a re-flow (NULL pointer OR zero length). | |
| bool | priv_reflow_internal_final_page_needed (uint32_t page_count, uint32_t token_count) |
| Decide whether the layout pass produced zero pages but the token stream was non-empty (must synthesise a final page). | |
Test-access surface for reflow internal helpers (MC/DC).
Not part of the public API. Tests under tests/ MAY include this header to drive compound boolean decisions that sit in TU-private helpers behind the public reflow facade. See CLAUDE.md "Test access to internal symbols (MC/DC scope)".
Definition in file reflow_internal.h.
| bool priv_reflow_internal_final_page_needed | ( | uint32_t | page_count, |
| uint32_t | token_count ) |
Decide whether the layout pass produced zero pages but the token stream was non-empty (must synthesise a final page).
Promoted from the inline AND decision in reflow_run_layout (line 750).
| [in] | page_count | Number of pages flushed during the pass. |
| [in] | token_count | Total parsed-token count. |
| true | Caller must synthesise a single final page. |
| false | No fixup required. |
Decide whether the layout pass produced zero pages but the token stream was non-empty (must synthesise a final page).
Promoted from line 750 in reflow_run_layout.
| [in] | page_count | Number of pages flushed during the pass. |
| [in] | token_count | Total parsed-token count. |
| true | Caller must synthesise a single final page. |
| false | No fixup required. |
Definition at line 135 of file reflow_layout.c.
Referenced by reflow_run_layout().
| bool priv_reflow_internal_is_indent_tag | ( | uint8_t | tag | ) |
Return true iff tag is a tag that introduces / removes a block-level indent (currently <li> and <blockquote>).
Promoted from the inline expressions in internal_open_block (line 479) and internal_close_block (line 513) so tests can drive both arms of the tag == li || tag == blockquote decision under -fcoverage-mcdc on the production source.
| [in] | tag | Token tag value (raw uint8_t storage of reflow_html_tag_t to keep this header free of public-API includes). |
| true | Tag is li or blockquote. |
| false | Otherwise. |
tag.Return true iff tag is a tag that introduces / removes a block-level indent (currently <li> and <blockquote>).
Pure helper factored out of internal_open_block (line 479) and internal_close_block (line 513) so the tag == li || tag == blockquote decision can be driven directly by host MC/DC tests via priv_reflow_internal_is_indent_tag.
| [in] | tag | Token tag value (raw uint8_t storage of reflow_html_tag_t). |
| true | Tag is k_reflow_tag_li or k_reflow_tag_blockquote. |
| false | Otherwise. |
tag.Definition at line 67 of file reflow_layout.c.
References k_reflow_tag_blockquote, and k_reflow_tag_li.
Referenced by internal_close_block(), and internal_open_block().
| bool priv_reflow_internal_right_overflow_break | ( | int32_t | cursor_x, |
| int32_t | advance, | ||
| int32_t | right_limit, | ||
| uint8_t | line_has_content ) |
Decide whether a glyph emission would overflow the right margin AND the current line already has content.
Promoted from the inline compound decisions in internal_emit_char (line 404), internal_layout_text (line 468) and priv_apply_image (line 605) so the cur->x + advance > right_limit && line_has_content != 0 AND decision can be driven directly under -fcoverage-mcdc.
| [in] | cursor_x | Current pen x position in pixels. |
| [in] | advance | Width about to be emitted in pixels. |
| [in] | right_limit | Right edge in pixels (viewport_w - margin). |
| [in] | line_has_content | Non-zero iff the current line already has at least one glyph. |
| true | Caller must call priv_newline before emitting. |
| false | Emitting in place is safe. |
Decide whether a glyph emission would overflow the right margin AND the current line already has content.
Promoted from inline expressions at original lines 404, 468 and 605 so MC/DC tests can drive both arms of the (cur->x + advance > right_limit) && line_has_content decision directly.
| [in] | cursor_x | Pen x position in pixels. |
| [in] | advance | Width about to be emitted in pixels. |
| [in] | right_limit | Right edge in pixels. |
| [in] | line_has_content | Non-zero iff the line already has glyphs. |
| true | Caller must call priv_reflow_layout_newline before emitting. |
| false | Emitting in place is safe. |
Definition at line 92 of file reflow_layout.c.
Referenced by internal_apply_image_placeholder(), internal_emit_char(), and internal_layout_text().
| bool priv_reflow_internal_xhtml_invalid | ( | const void * | xhtml_buf, |
| size_t | xhtml_len ) |
Decide whether the cached XHTML buffer pointer/length pair is unusable for a re-flow (NULL pointer OR zero length).
Promoted from the inline OR decision in reflow_set_font_size (line 953).
| [in] | xhtml_buf | Cached buffer pointer (may be NULL). |
| [in] | xhtml_len | Cached buffer length (may be zero). |
| true | Buffer is unusable; caller must return invalid_state. |
| false | Buffer is usable. |
Decide whether the cached XHTML buffer pointer/length pair is unusable for a re-flow (NULL pointer OR zero length).
Promoted from line 953 in reflow_set_font_size.
| [in] | xhtml_buf | Cached buffer pointer (may be NULL). |
| [in] | xhtml_len | Cached buffer length (may be zero). |
| true | Buffer is unusable. |
| false | Buffer is usable. |
Definition at line 115 of file reflow_layout.c.
Referenced by reflow_bind_font(), and reflow_set_font_size().