|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Test-only seams for post-validation XML reader faults. More...
#include <stddef.h>#include <stdint.h>#include "ra8_attributes.h"#include "ra8_err.h"#include "ra8_rabook_xml_shim.h"#include "rabook_compile.h"Go to the source code of this file.
Functions | |
| ra8_err_t | priv_ra8_rabook_xml_select_unvalidated_test (const uint8_t *source, size_t source_len, ra8_rabook_xml_workspace_t *workspace) |
| Run the XML subtree-selection pass without public validation. | |
| ra8_err_t | priv_ra8_rabook_xml_emit_unvalidated_test (const uint8_t *source, size_t source_len, ra8_rabook_ctx_t *ctx, ra8_rabook_xml_workspace_t *workspace) |
| Run XML subtree emission without public validation or rollback. | |
Test-only seams for post-validation XML reader faults.
Declares the bounded selection and emission entry points used to force second-pass reader failures after the public first-pass validator would otherwise reject the source.
Definition in file ra8_rabook_xml_shim_test_internal.h.
| ra8_err_t priv_ra8_rabook_xml_emit_unvalidated_test | ( | const uint8_t * | source, |
| size_t | source_len, | ||
| ra8_rabook_ctx_t * | ctx, | ||
| ra8_rabook_xml_workspace_t * | workspace ) |
Run XML subtree emission without public validation or rollback.
Drives emission from source offset zero at depth zero with a fresh pull reader. It deliberately omits the public validation and checkpoint restoration so a UNIT_TEST build can observe a failure that occurs after the selected root has begun emission.
| [in] | source | Immutable XML bytes, or nullptr for reader validation. |
| [in] | source_len | Exact readable extent of source in bytes. |
| [in,out] | ctx | Active bounded RABOOK builder receiving emitted nodes. |
| [in,out] | workspace | Exclusive XML reader and emission workspace. |
| k_ra8_ok | The selected root was consumed without a reader error. |
| k_ra8_err_null_ptr | source was nullptr. |
| k_ra8_err_invalid_size | source_len was zero or exceeded UINT32_MAX. |
| k_ra8_err_no_mem | Bounded builder capacity was exhausted. |
| k_ra8_err_validation_failed | XML traversal failed. |
ctx and workspace are non-null, initialized, and exclusive. source spans exactly source_len readable bytes. source is unchanged on every result. ctx may retain partial emission and workspace remains scratch; this narrow seam intentionally performs no public rollback. | ra8_err_t priv_ra8_rabook_xml_select_unvalidated_test | ( | const uint8_t * | source, |
| size_t | source_len, | ||
| ra8_rabook_xml_workspace_t * | workspace ) |
Run the XML subtree-selection pass without public validation.
Initialises a fresh pull reader over the supplied bytes and drives the post-validation selection logic. The selected coordinates are intentionally discarded; the seam exists only to verify defensive reader-failure propagation in a UNIT_TEST build.
| [in] | source | Immutable XML bytes, or nullptr for reader validation. |
| [in] | source_len | Exact readable extent of source in bytes. |
| [in,out] | workspace | Exclusive XML reader workspace. |
| k_ra8_ok | Selection reached a clean end or selected a direct body. |
| k_ra8_err_null_ptr | source was nullptr. |
| k_ra8_err_invalid_size | source_len was zero or exceeded UINT32_MAX. |
| k_ra8_err_validation_failed | XML traversal or the bounded direct-child search failed. |
workspace is non-null and not shared with another live reader. source spans exactly source_len readable bytes. source is unchanged on every result. workspace contains only scratch state from the completed or failed pass. workspace. References RA8_NODISCARD, and RA8_TEST_HELPER.