Skip to content

WriteFmt

Description

Write formatted output to the standard output stream (FileStdout()). This is a convenience macro calling FWriteFmt with FileStdout().

Parameters

Name Direction Description
fmtstr in Format string with {} placeholders.

Success

Placeholders in fmtstr are replaced by the passed arguments, and the resulting formatted string is written to standard output.

Failure

Failure might occur during memory allocation for the temporary string or during the write operation; the backend may also log an error message.

Usage example (Cross-references)

Usage examples (Cross-references)
    
    int main(void) {
        WriteFmt("[INFO] Starting PageProtect tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_file_read_into_str(void) {
        WriteFmt("Testing FileRead into Str (whole-file load)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_file_read_grows_str(void) {
        WriteFmt("Testing FileRead grows the Str backing buffer\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // rather than touching a stale fd.
    bool test_closed_file_ops_fail(void) {
        WriteFmt("Testing read/write/seek/tell on a closed file return errors\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // An invalid mode string yields a File that reports not-open.
    bool test_open_invalid_mode(void) {
        WriteFmt("Testing FileOpen with an invalid mode returns a not-open file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // observable values.
    bool test_write_seek_read_roundtrip(void) {
        WriteFmt("Testing FileWrite/FileSeek/FileTell/FileRead round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // request returns 0 without touching eof.
    bool test_eof_semantics(void) {
        WriteFmt("Testing EOF detection and zero-length read\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // must see only the new (shorter) content, never leftover tail bytes.
    bool test_write_mode_truncates(void) {
        WriteFmt("Testing \"w\" mode truncates prior content\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the end.
    bool test_append_mode_preserves(void) {
        WriteFmt("Testing \"a\" mode appends to prior content\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the open+op+close convenience round-trip.
    bool test_write_and_read_and_close(void) {
        WriteFmt("Testing FileWriteAndClose + FileReadAndClose round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // failed) rather than a bogus byte count.
    bool test_read_and_close_missing_path(void) {
        WriteFmt("Testing FileReadAndClose on a missing path returns -1\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // would succeed. Real code: "r" is read-only, FileWrite returns -1.
    bool test_fm_46_plus_init_false(void) {
        WriteFmt("Testing parse_open_mode: \"r\" opens read-only (plus init false)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // file opens read-only and writes fail. Real code: "r+" is read+write.
    bool test_fm_48_rplus_is_writable(void) {
        WriteFmt("Testing parse_open_mode: \"r+\" is writable (== '+' detection)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // or stops behaving as a read-only handle on the seeded content.
    bool test_fm_56_r_mode_reads_content(void) {
        WriteFmt("Testing parse_open_mode: \"r\" mode reads the seeded content back\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // it back. A constant 42 would surface 42 regardless of the argument.
    bool test_fm_172_fromfd_keeps_fd(void) {
        WriteFmt("Testing FileFromFd preserves the fd value (FileFd round-trip)\n");
    
    #if PLATFORM_WINDOWS
    // temp file, FileClose the borrowed wrapper, then keep using the owner.
    bool test_fm_173_fromfd_does_not_own(void) {
        WriteFmt("Testing FileFromFd borrows (owns=false): close is a no-op on the fd\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // eq_to_ne on `r == 0` would report failure on a clean close.
    bool test_fm_222_close_returns_true(void) {
        WriteFmt("Testing FileClose returns true on a clean close (r == 0)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // would attempt to close fd -1 and could report failure.
    bool test_fm_228_double_close_clears_owns(void) {
        WriteFmt("Testing FileClose clears owns: second close is a no-op true\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // byte counts the read/write syscalls report.
    bool test_fm_249_read_exact_count(void) {
        WriteFmt("Testing FileRead returns the exact byte count for a partial read\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // L270 `f->at_eof = true`: a zero-byte read at EOF sets the eof flag.
    bool test_fm_270_read_sets_eof(void) {
        WriteFmt("Testing FileRead at EOF sets the eof flag\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the eof flag so a subsequent read can succeed again.
    bool test_fm_317_seek_clears_eof(void) {
        WriteFmt("Testing FileSeek clears eof and returns the new offset\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // result return, line 328/332).
    bool test_fm_328_seek_cur_offset(void) {
        WriteFmt("Testing FileSeek SEEK_CUR returns the running absolute offset\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // right or the slurp drops/duplicates bytes.
    bool test_fm_403_remaining_size_from_midfile(void) {
        WriteFmt("Testing FileRead-to-EOF from a mid-file cursor reads only the tail\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // total when here == 0; guards the `end < here` and reserve logic).
    bool test_fm_394_remaining_size_full(void) {
        WriteFmt("Testing FileRead-to-EOF from start reads the whole file exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // total and full content (guards the reserve-size and grow-loop).
    bool test_fm_427_read_to_buf_large(void) {
        WriteFmt("Testing FileRead-to-Buf slurps a multi-chunk payload exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // content and length.
    bool test_fm_498_write_close_read_close_roundtrip(void) {
        WriteFmt("Testing FileWriteAndClose + FileReadAndClose exact round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the file to empty (so a subsequent read-and-close returns 0).
    bool test_fm_498_zero_length_write(void) {
        WriteFmt("Testing FileWriteAndClose with n==0 writes nothing, truncates file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // length and content.
    bool test_fm_514_write_close_from_buf(void) {
        WriteFmt("Testing FileWriteAndClose(Buf) writes the buffer length exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // length and content.
    bool test_fm_521_write_close_from_str(void) {
        WriteFmt("Testing FileWriteAndClose(Str) writes the string length exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // file with a non-empty path that round-trips a payload.
    bool test_fm_602_temp_open_roundtrips(void) {
        WriteFmt("Testing FileOpenTemp creates an open, writable, named file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // hex name, owns the new fd).
    bool test_fm_547_temp_names_distinct(void) {
        WriteFmt("Testing two FileOpenTemp calls yield distinct, independent files\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // truthy would make the closed case wrongly report success.
    bool test_fm_347_flush_open_vs_closed(void) {
        WriteFmt("Testing FileFlush returns true open / false closed (open gate)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // deadend pins that the abort fires.
    bool test_fm_498_null_buf_positive_n_aborts(void) {
        WriteFmt("Testing FileWriteAndClose(NULL, 5) aborts (NULL-buf contract)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // FileIsOpen on fd 0, so the `>= 0` vs `> 0` boundary is unpinned there.
    bool test_mut_240_isopen_fd_zero(void) {
        WriteFmt("Testing FileIsOpen reports a borrowed fd 0 as open (>= 0 boundary)\n");
    
    #if PLATFORM_WINDOWS
    // non-NULL buffer, so it never exercises the `!buf` arm at n == 0.
    bool test_mut_498_null_buf_zero_n_ok(void) {
        WriteFmt("Testing FileWriteAndClose(path, NULL, 0) returns 0 (n > 0 guard)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_close_releases_fd_slot(void) {
        WriteFmt("Testing FileClose actually releases the fd (slot is reused)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting File tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Buf tests\n\n");
        TestFunction tests[] = {
            test_buf_init_clear,
    
    int main(void) {
        WriteFmt("[INFO] Starting AllocDebug tests\n\n");
    
        TestFunction normal[] = {
        bool ok = (StrLen(&out) == ZstrLen(expected)) && (ZstrCompare(StrBegin(&out), expected) == 0);
        if (!ok) {
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        if (!ok) {
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        }
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        }
        StrDeinit(&out);
                  ZstrFindSubstring(StrBegin(&out), "--opt64") == NULL;
        if (!ok) {
            WriteFmt("[a1] render cap: window wrong\n{}\n", StrBegin(&out));
        }
        StrDeinit(&out);
    // so left_col is populated, drive --help, and require live_count == 0.
    static bool test_help_frees_left_col_strs(void) {
        WriteFmt("Testing print_help frees per-spec left-column Strs (414:9)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting ArgParse tests\n\n");
    
        TestFunction tests[] = {
    
    static bool test_graph_node_visit_scratch_state(void) {
        WriteFmt("Testing Graph node scratch visit state\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_mark_delete_commit_and_reuse(void) {
        WriteFmt("Testing GraphMarkNodeForDeletion and GraphCommitChanges\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_query_and_unmark_node_deletion(void) {
        WriteFmt("Testing Graph node mark query and unmark\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_mark_edge_for_removal(void) {
        WriteFmt("Testing GraphMarkEdgeForRemoval and deferred edge commit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_query_and_unmark_edge_removal(void) {
        WriteFmt("Testing Graph edge mark query and unmark\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_partial_unmark_of_multiple_edge_removals(void) {
        WriteFmt("Testing partial unmark of multiple pending edge removals\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_self_loop_edge_removal(void) {
        WriteFmt("Testing deferred removal of self-loop edge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_edge_removal_and_node_deletion_overlap(void) {
        WriteFmt("Testing overlap between pending edge removal and node deletion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_external_indexed_state_requires_reset_on_reuse(void) {
        WriteFmt("Testing external slot-indexed state across delete and reuse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_stale_node_handle_after_commit_deadend(void) {
        WriteFmt("Testing stale GraphNode handle after commit (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // caller-observable post-commit graph shape.
    static bool test_graph_commit_keeps_live_edge_before_removing_marked_edge(void) {
        WriteFmt("Testing commit keeps a live out-edge ordered before a marked-target edge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // succeeds.
    static bool test_graph_clear_resets_free_slot_visit_count(void) {
        WriteFmt("Testing GraphClear resets free-slot visit_count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // deletion).
    static bool test_graph_clear_empties_free_indices(void) {
        WriteFmt("Testing GraphClear empties free_indices before repopulating\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // slot and graph_validate_node_id aborts on "free slot". Real code skips it.
    static bool test_commit_with_free_slot_present_succeeds(void) {
        WriteFmt("Testing commit succeeds while a free-list slot is present\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // validation graph_find_pending_edge_removal_index just returns "not found".
    static bool test_edge_marked_stale_from_deadend(void) {
        WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale from id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // valid `from` with a stale `to` must abort.
    static bool test_edge_marked_stale_to_deadend(void) {
        WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale to id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // false rather than aborting.
    static bool test_unmark_edge_stale_from_deadend(void) {
        WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale from id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // valid `from` with a stale `to` must abort.
    static bool test_unmark_edge_stale_to_deadend(void) {
        WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale to id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes; the mutant aborts (killing the process).
    static bool test_find_neighbor_index_no_overscan(void) {
        WriteFmt("Testing graph_find_neighbor_index does not overscan past the adjacency end\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes (a deleted, c retained); the mutant aborts.
    static bool test_commit_pass2_no_overscan(void) {
        WriteFmt("Testing commit pass-2 does not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes (a deleted; c still marked + live); the mutant aborts.
    static bool test_commit_marked_passes_no_overscan(void) {
        WriteFmt("Testing commit marked passes do not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Ops tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_reserve_clear(void) {
        WriteFmt("Testing GraphReserve and GraphClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_deep_copy(void) {
        WriteFmt("Testing Graph node deep-copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_owned_str_rvalue(void) {
        WriteFmt("Testing Graph node owned Str r-value insertion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_init_optional_allocator(void) {
        WriteFmt("Testing Graph init optional allocator\n");
    
        typedef Graph(Str) StrGraph;
    // to at least the requested count.
    static bool test_graph_reserve_grows_capacity(void) {
        WriteFmt("Testing GraphReserve actually grows slot capacity\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Mark (but do not commit) an edge removal so a backing exists at teardown.
    static bool test_deinit_frees_pending_edge_removals_backing_no_leak(void) {
        WriteFmt("Testing GraphDeinit frees the pending-edge-removals backing (no leak)\n");
    
        DebugAllocator dbg = DebugAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Init tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Graph.Init");
    }
    
    static bool test_graph_add_node_semantics(void) {
        WriteFmt("Testing GraphAddNode semantics\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_add_edge_dedup(void) {
        WriteFmt("Testing GraphAddEdge deduplication\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_self_loop_and_predecessor_order(void) {
        WriteFmt("Testing Graph self-loop handling and predecessor order\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // detect concurrent structural mutation.
    static bool test_graph_reserve_growth_bumps_epoch(void) {
        WriteFmt("Testing GraphReserve growth bumps the mutation epoch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutation epoch, observable via GraphMutationEpoch.
    static bool test_graph_reuse_add_bumps_epoch(void) {
        WriteFmt("Testing successful slot-reuse add bumps the mutation epoch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // slot at a different index.
    static bool test_graph_failed_reuse_returns_slot_to_free_list(void) {
        WriteFmt("Testing failed reuse add returns the slot to the free list\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // bit) so the corrupted free slot is rejected.
    static bool test_graph_failed_reuse_resets_visit_count(void) {
        WriteFmt("Testing failed reuse add resets the freed slot visit count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // failing add. Routed through a DebugAllocator.
    static bool test_push_grow_copy_failure_frees_node_data(void) {
        WriteFmt("Testing grow-path copy failure frees the node-data buffer (no leak)\n");
    
        DebugAllocator dbg = make_lean_debug_allocator();
    // slot, then drive a failing reuse add and assert the live count is net-zero.
    static bool test_push_reuse_copy_failure_frees_node_data(void) {
        WriteFmt("Testing reuse-path copy failure frees the node-data buffer (no leak)\n");
    
        DebugAllocator dbg = make_lean_debug_allocator();
        };
    
        WriteFmt("[INFO] Starting Graph.Insert tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Graph.Insert");
    }
    
    static bool test_graph_type_defaults(void) {
        WriteFmt("Testing Graph defaults\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_aligned_init_and_id_layout(void) {
        WriteFmt("Testing Graph aligned init and node id layout\n");
    
        HeapAllocator alloc = HeapAllocatorInitAligned(32);
    // validating this valid graph does NOT abort. NORMAL test.
    static bool test_graph_validate_passes_with_marked_node(void) {
        WriteFmt("Testing deep ValidateGraph accepts a valid graph that has a marked node\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // > 1), re-arm the deep validator, and assert ValidateGraph aborts. DEADEND.
    static bool test_graph_non_pow2_alignment_rejected_deadend(void) {
        WriteFmt("Testing ValidateGraph rejects a non-power-of-two allocator alignment (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real code while removing the mask for the mutant). DEADEND.
    static bool test_graph_validate_catches_corrupt_slots_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted slots vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // does not mask the removed in-validator check (see slots-vec test). DEADEND.
    static bool test_graph_validate_catches_corrupt_free_indices_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted free_indices vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // check (see slots-vec test). DEADEND.
    static bool test_graph_validate_catches_corrupt_pending_edges_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted pending_edge_removals vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // if its index starts past the end). Kills 377:29 and 383:22.
    static bool test_graph_out_reverse_missing_predecessor_deadend(void) {
        WriteFmt("Testing validate_graph out-loop catches missing reverse predecessor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // broken. A loop that visits only index 0 misses it. Kills 377:87 (i++ -> i--).
    static bool test_graph_out_reverse_second_neighbor_deadend(void) {
        WriteFmt("Testing validate_graph out-loop visits every out-neighbor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // skipped wholesale if its index starts past the end). Kills 388:29 and 394:22.
    static bool test_graph_in_reverse_missing_outgoing_deadend(void) {
        WriteFmt("Testing validate_graph in-loop catches missing reverse outgoing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // visits only index 0 of in_neighbors misses it. Kills 388:86 (i++ -> i--).
    static bool test_graph_in_reverse_second_predecessor_deadend(void) {
        WriteFmt("Testing validate_graph in-loop visits every predecessor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // index starts past the end. Kills 417:23.
    static bool test_graph_free_index_points_to_occupied_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop rejects occupied target (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // it to (index > len) lets this out-of-bounds index through. Kills 419:24.
    static bool test_graph_free_index_out_of_bounds_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop rejects out-of-bounds index (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the first free index misses it. Kills 417:85 (i++ -> i--).
    static bool test_graph_free_index_second_entry_occupied_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop visits every entry (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Kills 428:23.
    static bool test_graph_pending_removal_missing_edge_deadend(void) {
        WriteFmt("Testing validate_graph pending-removal loop rejects missing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // first pending entry misses it. Kills 428:94 (i++ -> i--).
    static bool test_graph_pending_removal_second_entry_deadend(void) {
        WriteFmt("Testing validate_graph pending-removal loop visits every entry (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // is not an out-neighbor and force re-validation; real code aborts.
    static bool test_graph_validate_rejects_missing_pending_edge_deadend(void) {
        WriteFmt("Testing ValidateGraph rejects pending removal of a missing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Type tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_city_reachability(void) {
        WriteFmt("Testing GraphForeachNode and GraphNodeForeachNeighbor for reachability\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_foreach_with_external_map_counts(void) {
        WriteFmt("Testing nested foreach with external count tracking map\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_foreach_predecessors(void) {
        WriteFmt("Testing GraphNodeForeachPredecessor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphForeachNode rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_neighbor_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphNodeForeachNeighbor rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_predecessor_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphNodeForeachPredecessor rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // iteration completes over both nodes.
    static bool test_graph_reserve_no_grow_keeps_iterator_valid(void) {
        WriteFmt("Testing in-capacity GraphReserve does not invalidate traversal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // visits exactly the surviving nodes; the mutant visits the free slot too.
    static bool test_graph_foreach_skips_freed_slot(void) {
        WriteFmt("Testing GraphForeachNode visits only occupied slots after a commit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // without bumping the epoch, so the only surviving defense is line 1030.
    static bool test_neighbor_iter_validates_neighbor_id_deadend(void) {
        WriteFmt("Testing neighbor iteration rejects a corrupted neighbor id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // id to generation 0 after begin.
    static bool test_predecessor_iter_validates_predecessor_id_deadend(void) {
        WriteFmt("Testing predecessor iteration rejects a corrupted predecessor id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant begin returns cleanly. DEADEND.
    static bool test_neighbor_iter_begin_rejects_stale_handle_deadend(void) {
        WriteFmt("Testing graph_neighbor_iter_begin rejects a stale node handle (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // aborts. Mutant: no bump, no abort.
    static bool test_node_iteration_rejects_grow_mutation_deadend(void) {
        WriteFmt("Testing GraphForeachNode rejects a no-realloc slot-growing mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // code aborts on the next iteration step.
    static bool test_graph_clear_during_traversal_aborts_deadend(void) {
        WriteFmt("Testing GraphClear during traversal invalidates iterator (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // aborts on the next iteration step -> DEADEND.
    static bool test_graph_commit_invalidates_live_iterator_deadend(void) {
        WriteFmt("Testing GraphCommitChanges invalidates a live node iterator (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Caller-observable via the GraphForeachNode visit count.
    static bool test_node_iter_no_overscan_extra_slot(void) {
        WriteFmt("Testing GraphForeachNode does not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Foreach tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_access_helpers(void) {
        WriteFmt("Testing Graph access helpers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_has_edge_query(void) {
        WriteFmt("Testing GraphHasEdge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_cross_graph_node_handle_deadend(void) {
        WriteFmt("Testing GraphNodeData rejects foreign graph node handles (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_predecessor_access_oob_deadend(void) {
        WriteFmt("Testing GraphPredecessorAt out-of-bounds access (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_neighbor_access_oob_deadend(void) {
        WriteFmt("Testing GraphNeighborAt out-of-bounds access (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // it as contained (true) -- a deterministic divergence.
    static bool test_contains_node_rejects_index_equal_to_slot_count(void) {
        WriteFmt("Testing GraphContainsNode rejects index == slot count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // report as contained.
    static bool test_contains_node_free_slot_with_matching_generation(void) {
        WriteFmt("Testing GraphContainsNode rejects a freed slot whose generation matches\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // admits it.
    static bool test_graph_node_index_equal_to_slot_count_deadend(void) {
        WriteFmt("Testing node index equal to slot count is rejected (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // without aborting. Real code aborts on the stale id.
    static bool test_get_node_rejects_stale_id_deadend(void) {
        WriteFmt("Testing GraphGetNode rejects a stale node id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // a silent `false` instead of aborting on the caller bug.
    static bool test_has_edge_rejects_invalid_destination_deadend(void) {
        WriteFmt("Testing GraphHasEdge rejects an invalid destination id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // return without aborting.
    static bool test_node_at_stale_id_deadend(void) {
        WriteFmt("Testing GraphNodeAt rejects a stale node id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code aborts; mutant proceeds. DEADEND.
    static bool test_validate_node_id_rejects_free_slot_matching_generation_deadend(void) {
        WriteFmt("Testing graph_validate_node_id rejects a free slot whose generation matches (abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Access tests\n\n");
        return run_test_suite(
            tests,
    
    bool test_float_compare_small_small(void) {
        WriteFmt("Testing FloatCompare with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_very_large_large(void) {
        WriteFmt("Testing FloatCompare with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_very_large_small(void) {
        WriteFmt("Testing FloatCompare with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_wrappers(void) {
        WriteFmt("Testing Float compare macros\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_generic(void) {
        WriteFmt("Testing FloatCompare generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Two construction paths for the same value must hash to the same bucket.
    bool test_float_hash_determinism(void) {
        WriteFmt("Testing float_hash determinism\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // +1.5e3 / -1.5e3 / 1.5e2 all land in distinct buckets.
    bool test_float_hash_distinguishes(void) {
        WriteFmt("Testing float_hash sensitivity to sign / exponent / magnitude\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the GenericHash / GenericCompare-shaped helpers wire in directly.
    bool test_float_hash_as_map_key(void) {
        WriteFmt("Testing float_hash as Map<Float, u64> key\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the emulated mutant -- demonstrating equivalence, not a kill.
    static bool test_ff_probe_compare_error_paths(void) {
        WriteFmt("Probe: with-error compare keeps error=false on success\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // both-zero branch and returns 0 instead of the correct +1.
    static bool test_m5_compare_nonzero_vs_zero(void) {
        WriteFmt("Testing FloatCompare(5.0, 0.0) is strictly greater\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the both-zero branch and returns 0 instead of the correct -1.
    static bool test_m5_compare_zero_vs_nonzero(void) {
        WriteFmt("Testing FloatCompare(0.0, 5.0) is strictly less\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real ordering. Asserting the exact ordering value (+1) catches it.
    static bool test_m6_compare_u64_greater(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns +1 when greater\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Equality path: real code returns 0. A 42 return would fail this exact check.
    static bool test_m6_compare_u64_equal(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns 0 when equal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Less-than path: real code returns -1. The mutated return of 42 fails this.
    static bool test_m6_compare_u64_less(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns -1 when less\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // while also pinning the error contract on the success path.
    static bool test_m6_compare_u64_no_error_flag(void) {
        WriteFmt("Testing FloatCompare(Float, u64, &error) clears error on success\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_int_error_cleared(void) {
        WriteFmt("Testing float_compare_int_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_i64_error_cleared(void) {
        WriteFmt("Testing float_compare_i64_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_f32_error_cleared(void) {
        WriteFmt("Testing float_compare_f32_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // apart under the real xor mixing but collide under the `|=` mutant.
    bool test_blind_746_hash_exponent_xor(void) {
        WriteFmt("Testing float_hash exponent xor mixing (1 vs 1e2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // under the `|=` mutant.
    bool test_blind_750_hash_sign_xor(void) {
        WriteFmt("Testing float_hash sign xor mixing (3.14 vs -3.14)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // collide under the `|=` mutant but differ under real.
    bool test_blind_750_hash_sign_xor_int(void) {
        WriteFmt("Testing float_hash sign xor mixing (2 vs -2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the built library and reading the result.
    bool test_blind_745_hash_loop_bound(void) {
        WriteFmt("Testing float_hash exponent loop bound (hash of 1)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // kill from depending on a single magic constant.
    bool test_blind_745_hash_loop_bound_zero(void) {
        WriteFmt("Testing float_hash exponent loop bound (hash of 0)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Compare tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_init(void) {
        WriteFmt("Testing FloatInit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clear(void) {
        WriteFmt("Testing FloatClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clone(void) {
        WriteFmt("Testing FloatClone\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clone_inherits_allocator_config(void) {
        WriteFmt("Testing FloatClone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // The assign-const mutant sets it to 42 -> FloatExponent != 0 -> killed.
    static bool test_m10_normalize_zero_exponent(void) {
        WriteFmt("Testing float_normalize canonicalises zero exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // diverges from the FloatInit zero -> test fails -> mutant killed.
    bool test_ff_254_normalized_zero_sign_is_positive(void) {
        WriteFmt("Testing float_normalize canonical-zero sign (mutant 254)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // unchanged. This probe keeps passing under the emulated removal.
    bool test_ff_probe_to_int_negative(void) {
        WriteFmt("Probe: FloatToInt returns false for negative input\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // are both caller-observable, so the mutation is distinguished.
    bool test_m2_to_int_neg_exponent_exact(void) {
        WriteFmt("Testing FloatToInt on un-normalized 50e-1 (== 5)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the non-negative-exponent branch: 12 x 10^1 == 120.
    bool test_m2_to_int_integer_branch(void) {
        WriteFmt("Testing FloatToInt on 120 (exponent branch)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the zero branch: result must be 0 and the call must succeed.
    bool test_m2_to_int_zero(void) {
        WriteFmt("Testing FloatToInt on 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the negative branch: FloatToInt rejects negative inputs.
    bool test_m2_to_int_negative_rejected(void) {
        WriteFmt("Testing FloatToInt rejects -7\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exponent branch; the mutant fails to recognise 'E' and rejects the string.
    bool test_m3_uppercase_exponent_marker(void) {
        WriteFmt("Testing FloatTryFromStr handles uppercase 'E' exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exact resulting exponent.
    bool test_m3_min_exponent_boundary(void) {
        WriteFmt("Testing FloatTryFromStr accepts the INT64_MIN exponent boundary\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // printed string.
    bool test_m5_from_double_large_integer_exponent_zero(void) {
        WriteFmt("Testing FloatFrom(double) of a large integer keeps exponent 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Type tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_negate_abs(void) {
        WriteFmt("Testing FloatNegate and FloatAbs\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_small_small(void) {
        WriteFmt("Testing FloatAdd with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_very_large_large(void) {
        WriteFmt("Testing FloatAdd with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_generic(void) {
        WriteFmt("Testing FloatAdd generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_small_small(void) {
        WriteFmt("Testing FloatSub with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_very_large_large(void) {
        WriteFmt("Testing FloatSub with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_generic(void) {
        WriteFmt("Testing FloatSub generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_small_small(void) {
        WriteFmt("Testing FloatMul with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_very_large_small(void) {
        WriteFmt("Testing FloatMul with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_generic(void) {
        WriteFmt("Testing FloatMul generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_small_small(void) {
        WriteFmt("Testing FloatDiv with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_very_large_small(void) {
        WriteFmt("Testing FloatDiv with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_generic(void) {
        WriteFmt("Testing FloatDiv generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_by_zero(void) {
        WriteFmt("Testing FloatDiv divide-by-zero handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real: -2 + 5 = 3. Mutant: -3.
    bool test_m1_add_neg_lhs_larger_pos_rhs(void) {
        WriteFmt("Testing FloatAdd sign: -2 + 5 = 3\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the mutant; kept for behavioral coverage of the cmp<0 branch.
    bool test_m1_add_pos_lhs_larger_neg_rhs(void) {
        WriteFmt("Testing FloatAdd sign: 2 + (-5) = -3\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // yield -0.75.
    bool test_m1_add_sign_from_larger_magnitude(void) {
        WriteFmt("Testing FloatAdd sign w/ fractions: -0.25 + 1 = 0.75\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // gt_to_ge mutant the guard fires LOG_FATAL and the process aborts -> killed.
    static bool test_m10_mul_exp_max_boundary(void) {
        WriteFmt("Testing exponent-sum at INT64_MAX boundary (FloatMul)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // lt_to_le mutant aborts -> killed.
    static bool test_m10_mul_exp_min_boundary(void) {
        WriteFmt("Testing exponent-sum at INT64_MIN boundary (FloatMul)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exponent; the lt_to_le mutant aborts -> killed.
    static bool test_m10_div_exp_min_boundary(void) {
        WriteFmt("Testing exponent-diff at INT64_MIN boundary (FloatDiv)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // boundary exponent; the gt_to_ge mutant aborts -> killed.
    static bool test_m10_div_exp_max_boundary(void) {
        WriteFmt("Testing exponent-diff at INT64_MAX boundary (FloatDiv)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (call -> 42) mutants force ok truthy -> FloatDiv returns true -> killed.
    static bool test_m10_div_f64_by_zero_returns_false(void) {
        WriteFmt("Testing float_div_f64 propagates divide-by-zero failure\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   whose low bit is 0, so a negative input would lose its sign.
    bool test_m11_f32_sign(void) {
        WriteFmt("Testing float_try_from_f32_value sign bit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   well below 1, but the mutant lands far above it.
    bool test_m11_f32_denormal_exp(void) {
        WriteFmt("Testing float_try_from_f32_value denormal exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   distinct subnormals (m=1 vs m=3) would compare equal.
    bool test_m11_f32_denormal_mantissa(void) {
        WriteFmt("Testing float_try_from_f32_value denormal mantissa\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   `(bits >> 63) & 1ull` computes the IEEE sign bit; `<<` loses it.
    bool test_m11_f64_sign(void) {
        WriteFmt("Testing float_try_from_f64_value sign bit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   produce `mantissa << 42` instead of a tiny subnormal.
    bool test_m11_f64_denormal_exp(void) {
        WriteFmt("Testing float_try_from_f64_value denormal exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   subnormals to one value.
    bool test_m11_f64_denormal_mantissa(void) {
        WriteFmt("Testing float_try_from_f64_value denormal mantissa\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_int_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(Int 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_i64_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(i64 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_f32_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(f32 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // leading '+' must yield a positive value.
    bool test_m3_leading_plus_is_positive(void) {
        WriteFmt("Testing FloatTryFromStr keeps leading-'+' positive\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // succeed and produce the right value.
    bool test_m3_digit_nine_accepted(void) {
        WriteFmt("Testing FloatTryFromStr accepts the digit '9'\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_div_sanity(void) {
        WriteFmt("Testing float_div sanity (6/3=2, exact)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(u64) divide-by-zero returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_by_zero_leaves_result_unchanged(void) {
        WriteFmt("Testing FloatDiv(u64) divide-by-zero keeps result zero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_exact(void) {
        WriteFmt("Testing FloatDiv(u64) exact quotient\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Math tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_from_unsigned_integer(void) {
        WriteFmt("Testing FloatFrom with unsigned integer\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_signed_integer(void) {
        WriteFmt("Testing FloatFrom with signed integer\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_int_container(void) {
        WriteFmt("Testing FloatFrom with Int container\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_exact(void) {
        WriteFmt("Testing FloatToInt exact conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_fractional_failure(void) {
        WriteFmt("Testing FloatToInt fractional failure handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_negative_failure(void) {
        WriteFmt("Testing FloatToInt negative failure handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_string_round_trip(void) {
        WriteFmt("Testing Float string round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_try_to_str_allocator_inheritance(void) {
        WriteFmt("Testing FloatTryToStr allocator behavior\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_very_large_string_round_trip(void) {
        WriteFmt("Testing Float very large string round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_scientific_parse(void) {
        WriteFmt("Testing Float scientific parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_str_invalid(void) {
        WriteFmt("Testing FloatFromStr invalid format handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_str_null(void) {
        WriteFmt("Testing FloatFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_try_from_str_null(void) {
        WriteFmt("Testing FloatTryFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant (negative -> 42, truthy) flips that byte -> hashes differ -> killed.
    static bool test_m10_normalize_zero_sign_hash(void) {
        WriteFmt("Testing float_normalize canonicalises zero sign\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // un-normalized (mutant) result reports exponent 0.
    static bool test_m13_from_int_normalizes_exponent(void) {
        WriteFmt("Testing float_from_int trims trailing zeros (exponent)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // changes the value rather than just the representation.
    static bool test_m13_from_int_value_preserved(void) {
        WriteFmt("Testing float_from_int preserves numeric value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // confirm the normalized representation still renders correctly.
    static bool test_m13_from_int_negative_value(void) {
        WriteFmt("Testing float_from_int on multi-zero value then negate\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // trailing garbage even if it stringifies as a terminator.
    static bool test_m6_to_str_neg_exp_split(void) {
        WriteFmt("Testing FloatToStr fractional loop bound for 3.14\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // terminates. Asserting exact text and length 5 catches all three.
    static bool test_m6_to_str_leading_zeros(void) {
        WriteFmt("Testing FloatToStr leading-zero loop for 0.001\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // trailing zeros exactly. Guards the positive-exponent path of float_try_to_str.
    static bool test_m6_to_str_positive_exp(void) {
        WriteFmt("Testing FloatToStr positive-exponent trailing zeros for 100\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (saw_digit -> truthy) would accept it.
    static bool test_fg_465_digitless_dot_rejected(void) {
        WriteFmt("Testing float_try_from_str rejects digitless \".\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_fg_465_digitless_sign_dot_rejected(void) {
        WriteFmt("Testing float_try_from_str rejects digitless \"+.\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_fg_465_with_digit_accepted(void) {
        WriteFmt("Testing float_try_from_str still accepts \"1.\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // constructed Float against the Int 2^52 distinguishes them.
    bool test_blind_93_ieee_binexp_zero_exponent(void) {
        WriteFmt("Testing float_try_from_ieee_bits binexp==0 exponent (2^52)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // integer form. Under the exponent=42 mutant it would gain 42 trailing zeros.
    bool test_blind_93_ieee_binexp_zero_render(void) {
        WriteFmt("Testing float_try_from_ieee_bits binexp==0 render (2^52)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Convert tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_is_zero(void) {
        WriteFmt("Testing FloatIsZero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_is_negative(void) {
        WriteFmt("Testing FloatIsNegative\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_exponent(void) {
        WriteFmt("Testing FloatExponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Access tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_vec_swap_items(void) {
        WriteFmt("Testing VecSwapItems\n");
    
        // Create a vector of integers
    // Test VecReverse function
    bool test_vec_reverse(void) {
        WriteFmt("Testing VecReverse\n");
    
        // Create a vector of integers
    // Test VecSort function
    bool test_vec_sort(void) {
        WriteFmt("Testing VecSort\n");
    
        // Create a vector of integers
    // code LOG_FATALs on idx2 == length.
    bool test_swap_idx_equal_length_aborts(void) {
        WriteFmt("Testing swap rejects idx == length\n");
    
        typedef Vec(u32) U32Vec;
    //   it swaps an out-of-bounds slot -- so the abort must come from real code.
    bool test_swap_idx1_equal_length_aborts(void) {
        WriteFmt("Testing swap rejects idx1 == length (476:14)\n");
    
        typedef Vec(u32) U32Vec;
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Ops tests\n\n");
    
        // Array of test functions
    
    bool test_complex_vec_init(void) {
        WriteFmt("Testing vector initialization with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test push operations with complex structure
    bool test_complex_vec_push(void) {
        WriteFmt("Testing push operations with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test insert operations with complex structure
    bool test_complex_vec_insert(void) {
        WriteFmt("Testing insert operations with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test merge operations with complex structure
    bool test_complex_vec_merge(void) {
        WriteFmt("Testing merge operations with complex structure\n");
    
        // Create two vectors of ComplexItem with deep copy functions
    // Test L-value operations
    bool test_lvalue_operations(void) {
        WriteFmt("Testing L-value operations\n");
    
        // Create a vector of integers
    // Test fast operations
    bool test_fast_operations(void) {
        WriteFmt("Testing fast operations\n");
    
        // Create a vector of integers
    // Test delete operations
    bool test_delete_operations(void) {
        WriteFmt("Testing delete operations\n");
    
        // Create a vector of integers
    // Test edge cases
    bool test_edge_cases(void) {
        WriteFmt("Testing edge cases\n");
    
        // Create a vector of integers
    // Test VecPushBackL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_pushback(void) {
        WriteFmt("Testing VecPushBackL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecInsertL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_insert(void) {
        WriteFmt("Testing VecInsertL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecInsertFastL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_fast_insert(void) {
        WriteFmt("Testing VecInsertFastL zero-on-take with complex structures\n");
        bool result = true;
    // Test VecPushFrontL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_pushfront(void) {
        WriteFmt("Testing VecPushFrontL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecMergeL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_merge(void) {
        WriteFmt("Testing VecMergeL zero-on-take with complex structures\n");
    
        // Create a vector with no copy_init but with copy_deinit for proper cleanup
    // Test array operations with L-value semantics
    bool test_lvalue_zero_on_take_array_ops(void) {
        WriteFmt("Testing array operations with L-value semantics\n");
    
        // Create a vector with no copy_init but with copy_deinit for proper cleanup
    // clone_vec @ 201:21 (==0 -> !=0): a non-empty src must be fully cloned.
    bool test_clone_copies_first_element(void) {
        WriteFmt("Testing clone copies a non-empty source\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:15 (copy loop init 0 -> const 42).
    bool test_clone_includes_index_zero(void) {
        WriteFmt("Testing clone copy loop starts at index zero\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:24 (i < length -> i >= length).
    bool test_clone_loop_runs_for_nonempty(void) {
        WriteFmt("Testing clone copy loop condition\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:40 (i++ -> i--).
    bool test_clone_visits_every_element(void) {
        WriteFmt("Testing clone visits every source element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 210:14 (insert_range_into_vec(...) call replaced by 0).
    bool test_clone_insert_populates_dst(void) {
        WriteFmt("Testing clone appends each element to dst\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Complex tests\n\n");
    
        // Array of test functions
    // Test VecTryReduceSpace function
    bool test_vec_try_reduce_space(void) {
        WriteFmt("Testing VecTryReduceSpace\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecResize function
    bool test_vec_resize(void) {
        WriteFmt("Testing VecResize\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecReserve function
    bool test_vec_reserve(void) {
        WriteFmt("Testing VecReserve\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecClear function
    bool test_vec_clear(void) {
        WriteFmt("Testing VecClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 125:67 cxx_mul_to_div (grown-region zero byte count collapses to ~0).
    bool test_reserve_zero_low_slot(void) {
        WriteFmt("Testing reserve zeroes grown region (low slot)\n");
        return reserve_zero_grown_region(9);
    }
    // 125:72 cxx_add_to_sub (`(n + 1 - old_capacity)` -> `(n - 1 - old_capacity)`).
    bool test_reserve_zero_high_slot(void) {
        WriteFmt("Testing reserve zeroes grown region (high slot)\n");
        return reserve_zero_grown_region(11);
    }
    // 112:42 cxx_gt_to_ge -- multiplicative-overflow guard boundary.
    bool test_reserve_overflow_boundary_returns_false(void) {
        WriteFmt("Testing reserve at the overflow boundary returns false (112:42)\n");
    
        HeapAllocator heap = HeapAllocatorInit(); // alignment 1 -> aligned_size == 1
    // Str the buffer -- including the NUL sentinel -- must be zeroed.
    bool test_clear_str_scrubs_sentinel(void) {
        WriteFmt("Testing VecClear scrubs Str sentinel byte\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // mutation. A one-character Str has capacity == 1 exactly.
    bool test_clear_str_cap1_scrubs_sentinel(void) {
        WriteFmt("Testing VecClear scrubs single-char Str (capacity 1)\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clear_vec @ 84:18 / 84:20 (scrub MemSet stride forced to 42).
    bool test_clear_large_char_vec_scrub_stride(void) {
        WriteFmt("Testing VecClear scrub stride on a large char vector\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // once per live element.
    bool test_clear_runs_deinit_once_per_element(void) {
        WriteFmt("Testing VecClear invokes copy_deinit once per element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 165:18 (aligned_size := const 42 in the length>0 path).
    bool test_reduce_nonempty_preallocated_keeps_data(void) {
        WriteFmt("Testing reduce keeps element data for wide elements\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 166:21 (length == 0 -> length != 0).
    bool test_reduce_nonempty_keeps_length(void) {
        WriteFmt("Testing reduce preserves length of a non-empty vec\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 169:23 (capacity := const in the length==0 path).
    bool test_reduce_empty_capacity_zero(void) {
        WriteFmt("Testing reduce of an empty vec zeroes capacity\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 170:23 (length := const in the length==0 path).
    bool test_reduce_empty_length_zero(void) {
        WriteFmt("Testing reduce of an empty vec keeps length zero\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 188:23 (capacity := vec->length replaced by a const).
    bool test_reduce_shrinks_capacity_to_length(void) {
        WriteFmt("Testing reduce shrinks capacity to length\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // length > capacity.
    bool test_validate_rejects_length_over_capacity(void) {
        WriteFmt("Testing validate rejects length > capacity\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // wraps to a small allocation and later element writes run off the buffer.
    bool test_vec_reserve_capacity_overflow_aborts(void) {
        WriteFmt("Testing VecReserve capacity*item_size overflow aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Memory tests\n\n");
    
        alloc = DefaultAllocatorInit();
    // Test basic vector initialization
    bool test_vec_init_basic(void) {
        WriteFmt("Testing VecInit\n");
    
        // Test with int type
    // Test aligned vector initialization
    bool test_vec_init_aligned(void) {
        WriteFmt("Testing VecInit with aligned allocator\n");
    
        HeapAllocator aligned4  = HeapAllocatorInitAligned(4);
    // Test vector initialization with deep copy functions
    bool test_vec_init_with_deep_copy(void) {
        WriteFmt("Testing VecInitWithDeepCopy\n");
    
        // Test with struct type and custom copy/deinit functions
    // Test vector initialization with alignment and deep copy functions
    bool test_vec_init_aligned_with_deep_copy(void) {
        WriteFmt("Testing VecInit with aligned allocator and deep copy\n");
    
        HeapAllocator aligned8 = HeapAllocatorInitAligned(8);
    // Test vector initialization variants with an explicit optional allocator
    bool test_vec_init_optional_allocator(void) {
        WriteFmt("Testing VecInit optional allocator\n");
    
        typedef Vec(TestItem) TestVec;
    // Test vector stack initialization
    bool test_vec_init_stack(void) {
        WriteFmt("Testing VecInitStack\n");
    
        bool result = true;
    // Test vector clone initialization
    bool test_vec_init_clone(void) {
        WriteFmt("Testing vector cloning\n");
    
        // Create a source vector
    // element before storage is freed.
    bool test_deinit_runs_deinit_once_per_element(void) {
        WriteFmt("Testing VecDeinit invokes copy_deinit once per element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Init tests\n\n");
    
        alloc = DefaultAllocatorInit();
    
    bool test_vec_push_back(void) {
        WriteFmt("Testing VecPushBack\n");
    
        // Create a vector of integers
    // Test VecPushFront function
    bool test_vec_push_front(void) {
        WriteFmt("Testing VecPushFront\n");
    
        // Create a vector of integers
    // Test VecInsert function
    bool test_vec_insert(void) {
        WriteFmt("Testing VecInsert\n");
    
        // Create a vector of integers
    // Test VecPushBackArr function
    bool test_vec_push_back_arr(void) {
        WriteFmt("Testing VecPushBackArr\n");
    
        // Create a vector of integers
    // Test VecPushFrontArr function
    bool test_vec_push_front_arr(void) {
        WriteFmt("Testing VecPushFrontArr\n");
    
        // Create a vector of integers
    // Test VecInsertRange function for inserting at a specific index
    bool test_vec_push_arr(void) {
        WriteFmt("Testing VecInsertRange at specific index\n");
    
        // Create a vector of integers
    // Test VecInsertRange function for inserting from another vector
    bool test_vec_insert_range(void) {
        WriteFmt("Testing VecInsertRange from another vector\n");
    
        // Create a vector of integers
    // Test VecMerge function
    bool test_vec_merge(void) {
        WriteFmt("Testing VecMerge\n");
    
        // Create a vector of integers
    // the elements manually.)
    bool test_vec_init_clone_inherits_allocator_config(void) {
        WriteFmt("Testing manual clone allocator inheritance\n");
    
        typedef Vec(int) IntVec;
    // Test L-value and R-value operations
    bool test_lvalue_rvalue_operations(void) {
        WriteFmt("Testing L-value and R-value operations\n");
    
        // Create a vector of integers
    // Test that L-value insertions properly zero out values after insertion
    bool test_lvalue_zero_on_take_after_insertion(void) {
        WriteFmt("Testing L-value zero-on-take after insertion\n");
    
        // Create a vector of integers without copy_init
    // untouched prefix [0, idx) is intact.
    bool test_vec_insert_range_fast_overflowing_tail(void) {
        WriteFmt("Testing VecInsertRangeFast with count > (length - idx)\n");
    
        typedef Vec(int) IntVec;
    // mutant `>=` turns the boundary into a LOG_FATAL.
    bool test_fast_overflow_count_returns_false(void) {
        WriteFmt("Testing fast-insert SIZE_MAX count returns false (no abort)\n");
    
        ElemVec vec = VecInit(&alloc);
    // elements land correctly.
    bool test_grow_skip_underflow_predicate(void) {
        WriteFmt("Testing fast-insert grows when length+count reaches capacity\n");
    
        typedef Vec(int) IntVec;
    // post-insert capacity was actually bumped past the old non-pow2 value.
    bool test_grow_predicate_boundary_equal(void) {
        WriteFmt("Testing fast-insert grows at length+count == capacity boundary\n");
    
        typedef Vec(int) IntVec;
    // reservation, writing into a NULL/tiny buffer. Insert into an empty vec.
    bool test_grow_predicate_inverted(void) {
        WriteFmt("Testing fast-insert grows an empty vector\n");
    
        typedef Vec(int) IntVec;
    // realloc. A growth-needing insert must return true with all elements present.
    bool test_grow_reserve_result_honored(void) {
        WriteFmt("Testing fast-insert honors reserve growth result\n");
    
        typedef Vec(int) IntVec;
    // preserve every displaced original after the inserted block.
    bool test_displacement_move_size(void) {
        WriteFmt("Testing fast-insert preserves displaced tail (aligned_size)\n");
    
        ElemVec vec = VecInit(&alloc); // no copy hooks: plain MemCopy path
    // stays in bounds, producing the front-insert layout.
    bool test_displacement_move_overcopy(void) {
        WriteFmt("Testing fast-insert displacement move stays in bounds (over-copy)\n");
    
        ElemVec vec = VecInit(&alloc); // no copy hooks: plain MemCopy path
    // the untouched prefix [0, idx) survives a copy_init middle insert.
    bool test_prezero_target_index(void) {
        WriteFmt("Testing fast-insert leaves prefix intact (pre-zero index)\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // values 10,11,12,13
    // block holds the source items in order and prefix is intact.
    bool test_copy_init_dest_index(void) {
        WriteFmt("Testing fast-insert copy_init destination index\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // slot equals its distinct source element.
    bool test_copy_init_source_stride(void) {
        WriteFmt("Testing fast-insert copy_init source stride\n");
    
        ElemVec vec = make_filled_elem_vec(10, 2); // 10,11
    // non-zero seed makes the rollback deinit never-inited slots.
    bool test_first_element_failure_no_deinit(void) {
        WriteFmt("Testing fast-insert first-element failure runs no deinit\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // one copy_deinit (on idx+0) must fire. A non-zero start skips it -> leak.
    bool test_rollback_start_index_zero(void) {
        WriteFmt("Testing fast-insert rollback starts at slot 0\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // or records a flood of deinits.
    bool test_rollback_guard_first_fail(void) {
        WriteFmt("Testing fast-insert rollback guard on first failure\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4);
    // equals the number of successful copies and every deinit hit a live slot.
    bool test_rollback_guard_no_extra_deinit(void) {
        WriteFmt("Testing fast-insert rollback deinits only inited slots\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10..14
    // must be deinited.
    bool test_rollback_counter_increments(void) {
        WriteFmt("Testing fast-insert rollback counter advances\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5);
    // prefix originals.
    bool test_rollback_deinit_target(void) {
        WriteFmt("Testing fast-insert rollback deinit target index\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10..14
    // failure must yield exactly one deinit.
    bool test_inserted_counter_increments(void) {
        WriteFmt("Testing fast-insert success counter advances\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4);
    // failed middle insert the original tail must be intact.
    bool test_rollback_restore_source_first_term(void) {
        WriteFmt("Testing fast-insert rollback restore source (first term)\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10,11,12,13,14
    // reads past the parked block, restoring garbage. Original tail must survive.
    bool test_rollback_restore_source_second_term(void) {
        WriteFmt("Testing fast-insert rollback restore source (second term)\n");
    
        ElemVec vec = make_filled_elem_vec(20, 5); // 20,21,22,23,24
    // is restored. Assert every displaced original survives a failed insert.
    bool test_rollback_restore_size(void) {
        WriteFmt("Testing fast-insert rollback restore size\n");
    
        ElemVec vec = make_filled_elem_vec(30, 6); // 30..35
    // 234:15  cxx_gt_to_ge : `count > (size)-1 - length` overflow guard.
    bool test_insert_overflow_count_returns_false(void) {
        WriteFmt("Testing insert with count == SIZE_MAX returns false (no overflow)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 238:18  cxx_assign_const : `aligned_size = vec_aligned_size(...)` -> 42.
    bool test_aligned_size_const_preserves_originals(void) {
        WriteFmt("Testing front insert preserves originals (aligned_size assign)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 238:20  cxx_replace_scalar_call : replaces vec_aligned_size() with a scalar.
    bool test_aligned_size_call_preserves_originals(void) {
        WriteFmt("Testing front insert keeps first original (aligned_size call)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 249:26  cxx_sub_to_add : shift-right size `(length - idx)` -> `(length + idx)`.
    bool test_shift_right_size_middle_insert(void) {
        WriteFmt("Testing middle insert shift-right size\n");
    
        // Large N so that the `(length + idx)` over-copy of the mutant overruns the
    // 221:10  cxx_init_const : `inserted_count = 0` -> 42.
    bool test_rollback_first_item_no_deinit(void) {
        WriteFmt("Testing rollback on first-item failure deinit's nothing\n");
    
        int      tags[] = {1, 2, 3};
    // 257:27  cxx_init_const : rollback loop start `size s = 0` -> 42.
    bool test_rollback_loop_start_index(void) {
        WriteFmt("Testing rollback loop start index deinit's all inited items\n");
    
        int      tags[] = {1, 2, 3};
    // 257:36  cxx_lt_to_ge : rollback condition `s < inserted_count` -> `s >= ...`.
    bool test_rollback_cond_runs_for_inited(void) {
        WriteFmt("Testing rollback condition deinit's the single inited item\n");
    
        int      tags[] = {1, 2, 3};
    // 257:36  cxx_lt_to_le : rollback condition `s < inserted_count` -> `s <= ...`.
    bool test_rollback_cond_skips_failed_slot(void) {
        WriteFmt("Testing rollback never deinit's the failed slot\n");
    
        int      tags[] = {1, 2, 3};
    // 257:55  cxx_post_inc_to_post_dec : rollback step `s++` -> `s--`.
    bool test_rollback_step_increments(void) {
        WriteFmt("Testing rollback step deinit's every inited item\n");
    
        int      tags[] = {1, 2, 3};
    // 258:58  cxx_add_to_sub : rollback deinit target `idx + s` -> `idx - s`.
    bool test_rollback_deinit_target_slots(void) {
        WriteFmt("Testing rollback deinit targets the inserted slots\n");
    
        int      tags[] = {1}; // single existing element 'A' at slot 0
    // 273:27  cxx_post_inc_to_post_dec : `inserted_count++` -> `inserted_count--`.
    bool test_rollback_inserted_count_step(void) {
        WriteFmt("Testing inserted_count increment bounds the rollback loop\n");
    
        int      tags[] = {1, 2, 3};
    // 262:25  cxx_lt_to_ge : shift-back guard `idx < length` -> `idx >= length`.
    bool test_rollback_restore_middle_guard(void) {
        WriteFmt("Testing failed middle insert restores originals (shift-back guard)\n");
    
        int      tags[] = {1, 2, 3}; // A,B,C
    // 265:45  cxx_add_to_sub : shift-back source `idx + count` -> `idx - count`.
    bool test_rollback_restore_shiftback_source(void) {
        WriteFmt("Testing failed middle insert restores from correct source\n");
    
        int      tags[] = {1, 2, 3};
    // 266:38  cxx_sub_to_add : shift-back size `(length - idx)` -> `(length + idx)`.
    bool test_rollback_restore_shiftback_size_sub(void) {
        WriteFmt("Testing failed insert shift-back size (sub)\n");
    
        // Large N: the `(length + idx)` over-move of the mutant runs ~length
    // `(length - idx) / aligned`.
    bool test_rollback_restore_shiftback_size_div(void) {
        WriteFmt("Testing failed middle insert shift-back size (div)\n");
    
        int      tags[] = {1, 2, 3};
    // vec_insert_range_l, preserve-order path.
    bool test_insert_range_l_preserve_inserts_all(void) {
        WriteFmt("Testing VecInsertRangeL (preserve order) inserts all items\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // vec_insert_range_l, fast (non-preserve) path.
    bool test_insert_range_l_fast_inserts_all(void) {
        WriteFmt("Testing VecInsertRangeFastL inserts all items\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // vec_insert_one_l.
    bool test_insert_one_l_inserts_value(void) {
        WriteFmt("Testing VecInsertL inserts a single value\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // is false.
    bool test_insert_range_fast_l_reports_failure(void) {
        WriteFmt("Testing VecInsertRangeFastL reports copy_init failure (603:32)\n");
    
        // Canary allocator: the empty-vec / idx==length failure path also pins the
    // copy_init fails and assert the return is false with nothing landed.
    bool test_insert_one_l_reports_failure(void) {
        WriteFmt("Testing VecInsertL reports copy_init failure (584:10)\n");
    
        MutElemVec vec = VecInitWithDeepCopy(mut_copy_init, mut_copy_deinit, &alloc);
    // slots sit one-past-end and are observable.
    bool test_insert_fail_tail_zeroed(void) {
        WriteFmt("Testing insert failure zeroes vacated tail slots\n");
    
        ElemVec vec = VecInitWithDeepCopy(elem_copy_init, elem_copy_deinit, &alloc);
    // count >= 2) leaves the stale parked copies. Observable one-past-end.
    bool test_fast_insert_fail_tail_zeroed(void) {
        WriteFmt("Testing fast-insert failure zeroes parked tail slots\n");
    
        ElemVec vec = VecInitWithDeepCopy(elem_copy_init, elem_copy_deinit, &alloc);
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Insert tests\n\n");
    
        // Array of test functions
    // Test basic Vec type functionality
    bool test_vec_type_basic(void) {
        WriteFmt("Testing basic Vec type functionality\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateVec macro
    bool test_vec_validate(void) {
        WriteFmt("Testing ValidateVec macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Type tests\n\n");
    
        // Array of test functions
    
        // Print before state
        WriteFmt("Before fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Test VecDeleteRangeFast - delete 3 elements starting at index 2
    
        // Print after state
        WriteFmt("After fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check length after deletion
    
        // Print before state
        WriteFmt("Before L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Test L-value fast delete operation
    
        // Print after state
        WriteFmt("After L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after L-value fast deletion
    
        // Print before state
        WriteFmt("Before R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Remember the value to be deleted and the last value
    
        // Print after state
        WriteFmt("After R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check length
    
        // Print before state
        WriteFmt("Before L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Values that should be deleted (30, 40, 50)
    
        // Print after state
        WriteFmt("After L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after L-value fast range deletion
    
        // Print before state
        WriteFmt("Before R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Values that should be deleted (30, 40, 50)
    
        // Print after state
        WriteFmt("After R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after R-value fast range deletion
    // runs, so removed elements are dropped without releasing their resources.
    bool test_remove_deinit_init_zero(void) {
        WriteFmt("Testing remove copy_deinit loop starts at zero\n");
    
        reset_ledger();
    // body never runs.
    bool test_remove_deinit_runs_at_all(void) {
        WriteFmt("Testing remove copy_deinit loop runs\n");
    
        reset_ledger();
    // deinitializes a SURVIVING element.
    bool test_remove_deinit_no_overrun(void) {
        WriteFmt("Testing remove copy_deinit does not overrun window\n");
    
        reset_ledger();
    // 380:42 cxx_post_inc_to_post_dec (`s++` -> `s--`).
    bool test_remove_deinit_all_three(void) {
        WriteFmt("Testing remove copy_deinit covers every removed element\n");
    
        reset_ledger();
    // 382:29 cxx_replace_scalar_call (cursor stride replaced by constant 0).
    bool test_remove_deinit_advances_cursor(void) {
        WriteFmt("Testing remove copy_deinit advances per element\n");
    
        reset_ledger();
    // 395:22 cxx_sub_to_add (`length - start - count` -> `length + start - count`).
    bool test_remove_compaction_len_first_term(void) {
        WriteFmt("Testing remove compaction length (first term, large start)\n");
    
        typedef Vec(int) IntVec;
    // 395:30 cxx_sub_to_add (`length - start - count` -> `length - start + count`).
    bool test_remove_compaction_len_second_term(void) {
        WriteFmt("Testing remove compaction length (second term, large count)\n");
    
        typedef Vec(int) IntVec;
    // 395:41 cxx_replace_scalar_call (compaction MemMove stride replaced by 42).
    bool test_remove_compaction_stride(void) {
        WriteFmt("Testing remove compaction stride (large over-move)\n");
    
        typedef Vec(int) IntVec;
    // 397:41 cxx_sub_to_add (tail-clear `vec->length - count` -> `length + count`).
    bool test_remove_tail_clear_dest(void) {
        WriteFmt("Testing remove tail-clear destination\n");
    
        typedef Vec(int) IntVec;
    // 397:72 cxx_mul_to_div (`count * stride` -> `count / stride`).
    bool test_remove_tail_clear_len(void) {
        WriteFmt("Testing remove tail-clear length\n");
    
        typedef Vec(int) IntVec;
    // 397:74 cxx_replace_scalar_call (tail-clear stride replaced by constant 42).
    bool test_remove_tail_clear_stride(void) {
        WriteFmt("Testing remove tail-clear stride (large over-write)\n");
    
        typedef Vec(int) IntVec;
    // over-copy test relies on. Real code moves 0 bytes and returns cleanly.
    bool test_remove_compaction_size_first_term(void) {
        WriteFmt("Testing remove compaction size (length - start term)\n");
    
        typedef Vec(u64) U64Vec;
    // tail element and compacts correctly.
    bool test_remove_compaction_size_second_term(void) {
        WriteFmt("Testing remove compaction size (- count term)\n");
    
        typedef Vec(u64) U64Vec;
    
    bool test_vec_foreach(void) {
        WriteFmt("Testing VecForeach\n");
    
        // Create a vector of integers
    // Test VecForeachIdx macro
    bool test_vec_foreach_idx(void) {
        WriteFmt("Testing VecForeachIdx\n");
    
        // Create a vector of integers
    // Test VecForeachPtr macro
    bool test_vec_foreach_ptr(void) {
        WriteFmt("Testing VecForeachPtr\n");
    
        // Create a vector of integers
    // Test VecForeachPtrIdx macro
    bool test_vec_foreach_ptr_idx(void) {
        WriteFmt("Testing VecForeachPtrIdx\n");
    
        // Create a vector of integers
    // Test VecForeachReverse macro
    bool test_vec_foreach_reverse(void) {
        WriteFmt("Testing VecForeachReverse\n");
    
        // Create a vector of integers
    // Test VecForeachReverseIdx macro
    bool test_vec_foreach_reverse_idx(void) {
        WriteFmt("Testing VecForeachReverseIdx\n");
    
        // Create a vector of integers
    // Test VecForeachPtrReverse macro
    bool test_vec_foreach_ptr_reverse(void) {
        WriteFmt("Testing VecForeachPtrReverse\n");
    
        // Create a vector of integers
    // Test VecForeachPtrReverseIdx macro
    bool test_vec_foreach_ptr_reverse_idx(void) {
        WriteFmt("Testing VecForeachPtrReverseIdx\n");
    
        // Create a vector of integers
    // Make idx go out of bounds during VecForeach by modifying vector during iteration
    bool test_vec_foreach_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeach where modification causes out of bounds access (should crash)\n");
    
        typedef Vec(int) IntVec;
        int iteration_count = 0;
        VecForeach(&vec, val) {
            WriteFmt("Iteration {} (vec.length={}): {}\n", iteration_count, VecLen(&vec), val);
    
            // After 2nd iteration, shrink the vector dramatically
            if (iteration_count == 2) {
                VecResize(&vec, 2); // Shrink to only 2 elements
                WriteFmt("Vector resized to length {} during foreach iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachIdx by modifying vector during iteration
    bool test_vec_foreach_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=2, drastically shrink the vector to make the current idx invalid
            if (idx == 2) {
                VecResize(&vec, 2); // Shrink so that idx=2 becomes out of bounds (valid indices: 0,1)
                WriteFmt("Vector resized to length {}, current idx={} is now out of bounds...\n", VecLen(&vec), idx);
            }
    // Make idx go out of bounds in VecForeachReverseIdx by modifying vector during iteration
    bool test_vec_foreach_reverse_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachReverseIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachReverseIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachReverseIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=4, drastically shrink the vector
            if (idx == 4) {
                VecResize(&vec, 2); // Shrink to only 2 elements
                WriteFmt("Vector resized to length {} during reverse iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachPtrIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachPtrIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachPtrIdx(&vec, val_ptr, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=3, shrink the vector to make the CURRENT idx invalid
            if (idx == 3) {
                VecResize(&vec, 3); // Shrink so that idx=3 becomes out of bounds (valid indices: 0,1,2)
                WriteFmt("Vector resized to length {}, current idx={} is now out of bounds...\n", VecLen(&vec), idx);
            }
    // Make idx go out of bounds in VecForeachPtrReverseIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrReverseIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachPtrReverseIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachPtrReverseIdx(&vec, val_ptr, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=5, shrink the vector significantly
            if (idx == 5) {
                VecResize(&vec, 3); // Shrink to only 3 elements
                WriteFmt("Vector resized to length {} during reverse ptr iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachPtrInRangeIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrInRangeIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        size original_length = VecLen(&vec); // Capture this as 9
        VecForeachPtrInRangeIdx(&vec, val_ptr, idx, 0, original_length) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=3, delete several elements
            if (idx == 3) {
                VecDeleteRange(&vec, 0, 6); // Remove first 6 elements
                WriteFmt("Deleted first 6 elements, new length={}, idx = {}\n", VecLen(&vec), original_length, idx);
            }
    // Make idx go out of bounds in basic VecForeachIdx by modifying vector during iteration
    bool test_vec_foreach_idx_basic_out_of_bounds_access(void) {
        WriteFmt("Testing basic VecForeachIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // Basic VecForeachIdx now has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=2, drastically shrink the vector
            if (idx == 2) {
                VecResize(&vec, 1); // Shrink to only 1 element
                WriteFmt("Vector resized to length {}, current index={}\n", VecLen(&vec), idx);
            }
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Foreach.Simple tests\n\n");
    
        // Array of normal test functions
    // Test VecAt function
    bool test_vec_at(void) {
        WriteFmt("Testing VecAt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecPtrAt function
    bool test_vec_ptr_at(void) {
        WriteFmt("Testing VecPtrAt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecFirst and VecLast functions
    bool test_vec_first_last(void) {
        WriteFmt("Testing VecFirst and VecLast\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecBegin and VecEnd functions
    bool test_vec_begin_end(void) {
        WriteFmt("Testing VecBegin and VecEnd\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecSize and VecLen functions
    bool test_vec_size_len(void) {
        WriteFmt("Testing VecSize and VecLen\n");
    
        DefaultAllocator alloc    = DefaultAllocatorInit();
    // Test VecAlignedOffsetAt function
    bool test_vec_aligned_offset_at(void) {
        WriteFmt("Testing VecAlignedOffsetAt\n");
    
        DefaultAllocator alloc    = DefaultAllocatorInit();
    // Test VecEmpty, VecFind, and VecContains functions
    bool test_vec_empty_find_contains(void) {
        WriteFmt("Testing VecEmpty, VecFind, and VecContains\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `sizeof(u32)`, so they cannot diverge.
    bool test_aligned_stride_roundtrip(void) {
        WriteFmt("Testing element stride round-trips values\n");
    
        HeapAllocator alloc = HeapAllocatorInitAligned(16);
    // clone of distinct values produces duplicated/incorrect data.
    bool test_clone_reads_distinct_offsets(void) {
        WriteFmt("Testing clone reads each source element at its own offset\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Access tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClone\n");
    
        BitVec original = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_clone_inherits_allocator_config(void) {
        WriteFmt("Testing BitVecClone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClone edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec memory stress test\n");
    
        bool result = true;
    // Deadend tests
    bool test_bitvec_memory_null_failures(void) {
        WriteFmt("Testing BitVec memory NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec swap NULL handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_clone_null_failures(void) {
        WriteFmt("Testing BitVec clone NULL handling\n");
    
        // Test NULL pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing resize-grow clears stale tail bits\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve with zero capacity returns true\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Kills: 107:5 remove_void_call (ValidateBitVec dropped).
    bool test_resize_null_aborts(void) {
        WriteFmt("Testing BitVecResize NULL handle aborts\n");
    
        BitVecResize(NULL, 5);
    // Kills: 139:5 remove_void_call (ValidateBitVec dropped).
    bool test_reserve_null_aborts(void) {
        WriteFmt("Testing BitVecReserve NULL handle aborts\n");
    
        BitVecReserve(NULL, 5);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit preserves bits on a large vector\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit keeps the vector structurally valid\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap keeps a swapped-in large vector valid\n");
    
        BitVec small = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap aborts on an invalid second argument\n");
    
        BitVec good = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecTryClone aborts on an invalid source\n");
    
        BitVec out = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Memory tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInit\n");
    
        // Test basic initialization
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDeinit\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClear\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecResize\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInit edge cases\n");
    
        // Test multiple initializations
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReu64 edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClear edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec multiple init/deinit cycles\n");
    
        bool result = true;
    // Deadend tests - verify expected failures occur gracefully
    bool test_bitvec_null_pointer_failures(void) {
        WriteFmt("Testing BitVec NULL pointer handling\n");
    
        // Test NULL pointer passed to functions that should validate
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec invalid operations\n");
    
        // BitVecReserve is now a fallible API that returns bool on allocation
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set operations on invalid indices\n");
    
        // BitVecResize is now a fallible API that returns bool on allocation
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Init tests\n\n");
    
        // Array of normal test functions
    // Deadend tests - testing NULL pointers and invalid conditions that should cause fatal errors
    bool test_bitvec_find_deadend_tests(void) {
        WriteFmt("Testing BitVecFind deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    
    bool test_bitvec_predicate_deadend_tests(void) {
        WriteFmt("Testing BitVec predicate deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    
    bool test_bitvec_longest_run_deadend_tests(void) {
        WriteFmt("Testing BitVecLongestRun deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    // Deadend tests
    bool test_bitvec_access_null_failures(void) {
        WriteFmt("Testing BitVec access NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
    
    bool test_bitvec_set_null_failures(void) {
        WriteFmt("Testing BitVec set NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
    
    bool test_bitvec_flip_null_failures(void) {
        WriteFmt("Testing BitVec flip NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec flip bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get with large out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set with large out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec flip with edge case out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_count_null_failures(void) {
        WriteFmt("Testing BitVec count operations with NULL pointer\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get with maximum index value\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Access.Deadend tests\n\n");
    
        // Deadend tests that would cause program termination
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEquals\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecLexCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecNumericalCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecWeightCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSubset\n");
    
        BitVec subset   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSignedCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSuperset\n");
    
        BitVec superset = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOverlaps\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDisjoint and BitVecIntersects\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEqualsRange\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCompareRange\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsLexicographicallyLess and BitVecIsNumericallyLess\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSorted\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec compare edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set operations edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive comparison operations\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec large-scale comparison operations\n");
    
        BitVec large1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec compare NULL pointer handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_subset_null_failures(void) {
        WriteFmt("Testing BitVec subset NULL handling\n");
    
        // Test NULL pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec range operations NULL handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec range operations bounds checking\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_sorted_null_failures(void) {
        WriteFmt("Testing BitVec sorted operations NULL handling\n");
    
        // Test NULL pointer - should abort
    // Two bitvectors built the same way must hash identically.
    bool test_bitvec_hash_determinism(void) {
        WriteFmt("Testing bitvec_hash determinism\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // share a byte prefix but differ in length must still distinguish.
    bool test_bitvec_hash_distinguishes(void) {
        WriteFmt("Testing bitvec_hash sensitivity to bits and length\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // shaped helpers wired in directly -- no per-callsite cast needed.
    bool test_bitvec_hash_as_map_key(void) {
        WriteFmt("Testing bitvec_hash as Map<BitVec, u64> key\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // equality / identity. Mirrors how str_compare is exercised.
    bool test_bitvec_compare_callback(void) {
        WriteFmt("Testing bitvec_compare as GenericCompare callback\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEquals rejects bad second operand\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEqualsRange rejects bad second operand\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset scans past index 42\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset with shorter bv1 stays in bounds\n");
    
        BitVec bv1 = BitVecInit(base); // length 2
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset with shorter bv2 stays in bounds\n");
    
        BitVec bv1 = BitVecInit(base); // length 5
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint scans beyond position 0\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset rejects NULL bv2\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint rejects NULL bv1\n");
    
        BitVec bv2 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint rejects NULL bv2\n");
    
        BitVec bv1 = BitVecInit(base);
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Compare tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPush\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsert (single bit)\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertPattern\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertPattern edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
    // Deadend tests
    bool test_bitvec_insert_null_failures(void) {
        WriteFmt("Testing BitVec insert NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec insert invalid range handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_insert_pattern_null_failures(void) {
        WriteFmt("Testing BitVec insert pattern NULL handling\n");
    
        // Test NULL bitvec - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange shifts existing tail bits\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple shifts existing tail bits\n");
    
        BitVec bv    = BitVecInit(ALLOCATOR_OF(&alloc));
    // With validation removed, a NULL bitvec is accepted instead of aborting.
    bool test_insert_null_aborts(void) {
        WriteFmt("Testing BitVecInsert NULL validation\n");
    
        BitVecInsert(NULL, 0, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple NULL bv validation\n");
    
        BitVec other = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple NULL other validation\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Insert tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern(NULL, pattern) - should fatal\n");
    
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern(source, NULL) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern(NULL, pattern) - should fatal\n");
    
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern(source, NULL) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
    // Deadend test 5: BitVecFindAllPattern with NULL source
    bool test_bitvec_find_all_pattern_null_source(void) {
        WriteFmt("Testing BitVecFindAllPattern(NULL, pattern, results, 10) - should fatal\n");
    
        size results[10];
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, NULL, results, 10) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, pattern, NULL, 10) - should fatal\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, pattern, results, 0) - should fatal\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith(NULL, prefix) - should fatal\n");
        BitVec prefix = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&prefix, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith(NULL, suffix) - should fatal\n");
        BitVec suffix = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&suffix, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt(NULL, pattern, 0) - should fatal\n");
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&pattern, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt(source, NULL, 0) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    
    bool test_bitvec_replace_null_source(void) {
        WriteFmt("Testing BitVecReplace(NULL, old, new) - should fatal\n");
    
        // Don't create BitVecs since we're testing NULL source validation
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecMatches(NULL, pattern, wildcard) - should fatal\n");
        BitVec pattern  = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVec wildcard = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_regex_match_null_source(void) {
        WriteFmt("Testing BitVecRegexMatch(NULL, pattern) - should fatal\n");
        BitVecRegexMatch(NULL, "101");
        return true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRegexMatch(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    bool test_bitvec_prefix_match_null_source(void) {
        DefaultAllocator alloc = DefaultAllocatorInit();
        WriteFmt("Testing BitVecPrefixMatch(NULL, patterns, 1) - should fatal\n");
        BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        BitVecPush(VecPtrAt(&vp, 0), true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch(source, NULL, 1) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    bool test_bitvec_suffix_match_null_source(void) {
        DefaultAllocator alloc = DefaultAllocatorInit();
        WriteFmt("Testing BitVecSuffixMatch(NULL, patterns, 1) - should fatal\n");
        BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        BitVecPush(VecPtrAt(&vp, 0), true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch(source, NULL, 1) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    // would let the NULL flow into `bv->length` instead.
    bool test_find_last_null_bv_aborts(void) {
        WriteFmt("Testing BitVecFindLast with NULL bitvector\n");
        BitVecFindLast(NULL, true);
        return true; // Should never reach here.
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern (vec) with NULL bitvector\n");
    
        BitVec pattern = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern (vec) with NULL pattern\n");
    
        BitVec source = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplace(src, old, NULL) with old absent - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(uninitialized, old, new) - should fatal\n");
    
        BitVec bad         = {0}; // magic mismatch -> ValidateBitVec aborts
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(empty, NULL, new) - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc)); // empty
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(empty, old, NULL) - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc)); // empty
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch(NULL, empty) - should fatal\n");
    
        BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch(NULL, empty) - should fatal\n");
    
        BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Pattern.Deadend tests\n\n");
    
        // Deadend tests that would cause program termination
    
    bool test_bitvec_run_lengths_null_bv(void) {
        WriteFmt("Testing BitVecRunLengths with NULL bitvector\n");
    
        u64  runs[5];
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with NULL runs array\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with NULL values array\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with zero max_runs\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach with invalid bitvec\n");
    
        // Test foreach with invalid bitvec (length > 0 but data is NULL)
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecRunLengths (vec) with NULL bitvector\n");
    
        BitVecRuns runs = VecInitT(runs, base);
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Foreach.Deadend tests\n\n");
    
        // Array of deadend test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeach macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachReverseIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachReverse macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachInRangeIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachInRange macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach idx edge cases\n");
    
        BitVec bv       = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach reverse edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach range edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach stress test\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths basic functionality\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecRunLengths Vec form\n");
    
        BitVec bv = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths edge cases\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths boundary conditions\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths stress test\n");
    
        bool result = true;
    // Main function that runs all simple tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Foreach.Simple tests\n\n");
    
        // Array of normal test functions
    // Test basic BitVec type functionality
    bool test_bitvec_type_basic(void) {
        WriteFmt("Testing basic BitVec type functionality\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateBitVec macro
    bool test_bitvec_validate(void) {
        WriteFmt("Testing ValidateBitVec macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real code and dies (longjmp) under the mutant.
    bool test_validate_memoization_skips_structural(void) {
        WriteFmt("Testing ValidateBitVec honours the validated-bit memoization (1943:23)\n");
    
        BitVec bv = {0};
    // mutant skips it and returns. Deadend => expects the abort.
    bool test_structural_byte_size_check_aborts(void) {
        WriteFmt("Testing validate_bitvec_structural catches an undersized byte_size (1926:22)\n");
    
        BitVec bv    = {0};
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Type tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecNot\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShiftLeft\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShiftRight\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRotateLeft\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRotateRight\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReverse\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec shift edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec rotate edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReverse edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive bitwise operations\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive shift operations\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive rotate operations\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise identity operations\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise commutative properties\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations with large patterns\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr widens past shorter operand a\n");
    
        BitVec a      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor widens past shorter operand a\n");
    
        BitVec a      = BitVecInit(ALLOCATOR_OF(&alloc));
    bool test_rotate_right_frees_temp_clone(void);
    bool test_rotate_right_frees_temp_clone(void) {
        WriteFmt("Testing BitVecRotateRight frees its temp clone (1157:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
    bool test_rotate_left_frees_temp_clone(void);
    bool test_rotate_left_frees_temp_clone(void) {
        WriteFmt("Testing BitVecRotateLeft frees its temp clone (1131:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.BitWise tests\n\n");
    
        // Array of normal test functions
    // Deadend tests
    bool test_bitvec_bitwise_null_failures(void) {
        WriteFmt("Testing BitVec bitwise NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations NULL handling\n");
    
        BitVec bv  = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_reverse_null_failures(void) {
        WriteFmt("Testing BitVec reverse NULL handling\n");
    
        // Test NULL pointer - should abort
    // NEW: Additional deadend tests
    bool test_bitvec_shift_ops_null_failures(void) {
        WriteFmt("Testing BitVec shift operations NULL handling\n");
    
        // Test NULL pointer for shift right - should abort
    
    bool test_bitvec_rotate_ops_null_failures(void) {
        WriteFmt("Testing BitVec rotate operations NULL handling\n");
    
        // Test NULL pointer for rotate - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec AND with NULL result handling\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec OR with NULL operand handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec XOR with NULL second operand handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec NOT with NULL handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd rejects bad third operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd rejects bad second operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr rejects bad second operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor rejects bad third operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.BitWise.Deadend tests\n\n");
    
        // Array of deadend test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing basic BitVec pattern functions\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern Vec form\n");
    
        BitVec source  = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec pattern edge cases\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec pattern stress tests\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith edge cases\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith edge cases\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt edge cases\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCountPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplace basic functionality\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll basic functionality\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecMatches basic functionality\n");
    
        BitVec source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFuzzyMatch basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRegexMatch basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch basic functionality\n");
    
        BitVec  source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch basic functionality\n");
    
        BitVec  source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-condition (ge_to_lt)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-condition (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-value (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern loop-seed (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern loop-guard (gt_to_ge)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll found-flag init\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll forward-scan direction\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing bitvec_regex_match_str returns false on non-match\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
    bool test_regex_match_zstr_frees_rendered_str(void);
    bool test_regex_match_zstr_frees_rendered_str(void) {
        WriteFmt("Testing bitvec_regex_match_zstr frees its rendered Str (1866:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    bool test_regex_match_str_frees_rendered_str(void);
    bool test_regex_match_str_frees_rendered_str(void) {
        WriteFmt("Testing bitvec_regex_match_str frees its rendered Str (1883:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Pattern.Simple tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy basic functionality\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec Math stress tests\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
    
    bool test_bitvec_entropy_null(void) {
        WriteFmt("Testing BitVecEntropy(NULL) - should fatal\n");
        BitVecEntropy(NULL);
        return true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore(NULL, bv2, 1, -1) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore(bv1, NULL, 1, -1) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment(NULL, bv2) - should fatal\n");
        BitVec bv2 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv2, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment(bv1, NULL) - should fatal\n");
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&bv1, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity guard only fires when both empty\n");
    
        BitVec empty = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity with bv1 shorter than bv2\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity with bv2 shorter than bv1\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity reads bv2 bits in valid region\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance column-0 base case\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance deletion term\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance empty->len base row fill\n");
    
        // Stamp large values into the scratch arena: a 6-vs-6 edit distance fills
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance base row counter advances forward\n");
    
        // warm_b length == target bv2 length (4): freed scratch rows match the size
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance insertion term\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity rejects bad second operand\n");
    
        BitVec empty = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation with bv1 shorter than bv2 (no OOB)\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation with bv2 shorter than bv1 (no OOB)\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy on an unbalanced (3 ones, 1 zero) vector\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment all-mismatch best offset == 3\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity of identical vectors == 1.0\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy of a 3:1 distribution\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Math tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPop\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemove (single bit)\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveRange\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveFirst\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveLast\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveAll\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPop edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemove edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveRange edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveFirst/Last edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveAll edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
    // Deadend tests
    bool test_bitvec_remove_null_failures(void) {
        WriteFmt("Testing BitVec remove NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
    
    bool test_bitvec_remove_range_null_failures(void) {
        WriteFmt("Testing BitVec remove range NULL handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec remove invalid range handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec pop bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec remove bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec remove range bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveRange clamps oversized count\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveRange clamp gap count\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemoveRange shifts tail down\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // 424:5 remove_void_call -- BitVecRemove must validate its bitvec argument.
    bool test_remove_null_aborts(void) {
        WriteFmt("Testing BitVecRemove NULL validation\n");
    
        BitVecRemove(NULL, 0);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRemove rejects idx == length\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // 465:5 remove_void_call -- BitVecRemoveFirst must validate its bitvec argument.
    bool test_remove_first_null_aborts(void) {
        WriteFmt("Testing BitVecRemoveFirst NULL validation\n");
    
        BitVecRemoveFirst(NULL, true);
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Remove tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecToStr\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFromStr\n");
    
        // Convert from string
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecToBytes\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFromBytes\n");
    
        // Create byte array
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecToInteger\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFromInteger\n");
    
        // Convert from integer
    
    bool test_bitvec_try_conversion_allocators(void) {
        WriteFmt("Testing BitVec try conversion allocator behavior\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFromBytes with zero bit length\n");
    
        u8     dummy_bytes[1] = {0xFF};
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec convert edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFromStr edge cases\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bytes conversion edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec integer conversion edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec round-trip conversions\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec conversion bounds checking\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive conversion validation\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec large-scale conversions\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bytes zero max_len handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_integer_bounds_failures(void) {
        WriteFmt("Testing BitVec integer bounds failures\n");
    
        // Test BitVecToInteger with NULL pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec convert NULL pointer handling\n");
    
        // Use the explicit-allocator form so the NULL bitvec reaches the
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec from string NULL handling\n");
    
        // Test NULL string - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bytes NULL handling\n");
    
        // Test NULL bytes - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecToBytes 4-bit pack does not over-read\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecToBytes truncation respects max_len\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // must abort, so removing the validator is a contract loss => DEADEND.
    bool test_tobytes_zeroed_bitvec_aborts(void) {
        WriteFmt("Testing BitVecToBytes aborts on an invalid (zeroed) bitvec\n");
    
        BitVec bv = {0}; // bad magic -> ValidateBitVec must abort
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Convert tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecGet\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSet\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFlip\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecLength and BitVecCapacity\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCount operations\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecGet edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSet edge cases\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFlip edge cases\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCount edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec multiple access operations\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec access with large patterns\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec macro functions\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec access stress test\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive bit patterns\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFind functions\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec predicate functions\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecLongestRun\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFind edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec predicate edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecLongestRun edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Access.Simple tests\n\n");
    
        // Array of test functions
    
    bool test_int_compare(void) {
        WriteFmt("Testing IntCompare\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_compare_wrappers(void) {
        WriteFmt("Testing Int compare wrappers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_compare_generic(void) {
        WriteFmt("Testing IntCompare generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Same magnitude built two ways must hash to the same bucket.
    bool test_int_hash_determinism(void) {
        WriteFmt("Testing int_hash determinism\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // over a handful of small distinct inputs should not clash here.
    bool test_int_hash_distinguishes(void) {
        WriteFmt("Testing int_hash distinguishes distinct values\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // GenericHash / GenericCompare-shaped helpers wire in directly.
    bool test_int_hash_as_map_key(void) {
        WriteFmt("Testing int_hash as Map<Int,u64> key\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m24_compare_u64_64bit_equal(void) {
        WriteFmt("Testing IntCompare(2^63, 2^63) == 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `lhs_value < rhs` branch alongside the wide-value guard.
    bool test_m24_compare_u64_below(void) {
        WriteFmt("Testing IntCompare(7, 9) == -1\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code returns true; the mutant returns false -> distinguishable.
    bool test_m27_is_one_of_one(void) {
        WriteFmt("Testing IntIsOne(1) returns true\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_compare_i64_zero_is_equal(void) {
        WriteFmt("Testing int_compare_i64 zero equality (lt-vs-le guard)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_compare_i64_null_lhs_deadend(void) {
        WriteFmt("Testing int_compare_i64 NULL lhs validation\n");
    
        (void)int_compare_i64(NULL, (i64)-5);
    
    int main(void) {
        WriteFmt("[INFO] Starting Int.Compare tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_int_init(void) {
        WriteFmt("Testing IntInit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_clear(void) {
        WriteFmt("Testing IntClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_clone(void) {
        WriteFmt("Testing IntClone\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_clone_inherits_allocator_config(void) {
        WriteFmt("Testing IntClone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code yields 256 with bit length 9; the mutant diverges on both checks.
    bool test_m27_normalize_trims_via_add(void) {
        WriteFmt("Testing int_normalize resize length via IntAdd(255,1)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // integer.
    bool test_fe_96_u64_bits_construct(void) {
        WriteFmt("Testing int_u64_bits construction width\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Int.Type tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_int_shift_left_grows(void) {
        WriteFmt("Testing IntShiftLeft\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_shift_right_shrinks(void) {
        WriteFmt("Testing IntShiftRight\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_add(void) {
        WriteFmt("Testing IntAdd\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_add_generic(void) {
        WriteFmt("Testing IntAdd generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_sub(void) {
        WriteFmt("Testing IntSub\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_sub_generic(void) {
        WriteFmt("Testing IntSub generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_sub_underflow_preserves_result(void) {
        WriteFmt("Testing IntSub underflow handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mul(void) {
        WriteFmt("Testing IntMul\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mul_scalar(void) {
        WriteFmt("Testing IntMul generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mul_zero(void) {
        WriteFmt("Testing IntMul with zero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_square(void) {
        WriteFmt("Testing IntSquare\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_pow_generic(void) {
        WriteFmt("Testing IntPow generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_mod(void) {
        WriteFmt("Testing IntDivMod generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div(void) {
        WriteFmt("Testing IntDiv generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_exact(void) {
        WriteFmt("Testing IntDivExact generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_exact_failure_preserves_result(void) {
        WriteFmt("Testing IntDivExact failure handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_mod_scalar(void) {
        WriteFmt("Testing IntDivMod scalar-divisor dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod(void) {
        WriteFmt("Testing IntMod generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_scalar(void) {
        WriteFmt("Testing IntMod scalar-divisor dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_gcd(void) {
        WriteFmt("Testing IntGCD\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_lcm(void) {
        WriteFmt("Testing IntLCM\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_root(void) {
        WriteFmt("Testing IntRoot\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_root_rem(void) {
        WriteFmt("Testing IntRootRem\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_sqrt(void) {
        WriteFmt("Testing IntSqrt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_sqrt_rem(void) {
        WriteFmt("Testing IntSqrtRem\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_perfect_square(void) {
        WriteFmt("Testing IntIsPerfectSquare\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_perfect_power(void) {
        WriteFmt("Testing IntIsPerfectPower\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_jacobi(void) {
        WriteFmt("Testing IntJacobi\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_square_mod(void) {
        WriteFmt("Testing IntSquareMod\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_add(void) {
        WriteFmt("Testing IntModAdd\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_sub(void) {
        WriteFmt("Testing IntModSub\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_mul(void) {
        WriteFmt("Testing IntModMul\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_div(void) {
        WriteFmt("Testing IntModDiv\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_pow_mod_scalar(void) {
        WriteFmt("Testing IntPowMod scalar-exponent dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_pow_mod_integer_exponent(void) {
        WriteFmt("Testing IntPowMod Int-exponent dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_inv(void) {
        WriteFmt("Testing IntModInv\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_sqrt(void) {
        WriteFmt("Testing IntModSqrt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_sqrt_no_solution(void) {
        WriteFmt("Testing IntModSqrt no-solution case\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_probable_prime(void) {
        WriteFmt("Testing IntIsProbablePrime\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_next_prime(void) {
        WriteFmt("Testing IntNextPrime\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_inv_no_solution(void) {
        WriteFmt("Testing IntModInv no-solution case\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_div_no_solution(void) {
        WriteFmt("Testing IntModDiv no-solution case\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_add_null_result(void) {
        WriteFmt("Testing IntAdd NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_shift_left_null(void) {
        WriteFmt("Testing IntShiftLeft NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_by_zero(void) {
        WriteFmt("Testing Int division by zero handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_root_zero_degree(void) {
        WriteFmt("Testing IntRoot zero-degree handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_div_scalar_zero_divisor(void) {
        WriteFmt("Testing IntDiv scalar zero-divisor handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_scalar_zero_modulus(void) {
        WriteFmt("Testing IntMod scalar zero-modulus handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_mod_div_zero_modulus(void) {
        WriteFmt("Testing IntModDiv zero modulus handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_jacobi_even_denominator(void) {
        WriteFmt("Testing IntJacobi even denominator handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_pow_mod_scalar_zero_modulus(void) {
        WriteFmt("Testing IntPowMod scalar-exponent zero modulus handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_pow_mod_integer_zero_modulus(void) {
        WriteFmt("Testing IntPowMod Int-exponent zero modulus handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_p3mod4_residue(void) {
        WriteFmt("Testing IntModSqrt p==3 mod 4 residue (p=7,a=2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Kills the Jacobi guard (2471) and the modulus==2 misfire (2452).
    bool test_m1_modsqrt_p3mod4_nonresidue_preserves_result(void) {
        WriteFmt("Testing IntModSqrt p==3 mod 4 non-residue (p=7,a=3)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_p1mod4_tonelli_deep(void) {
        WriteFmt("Testing IntModSqrt Tonelli deep (p=17,a=2,m=4)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // IntSquareMod (2647), and m = i (2720).
    bool test_m1_modsqrt_p1mod4_tonelli_jloop(void) {
        WriteFmt("Testing IntModSqrt Tonelli j-loop (p=17,a=4)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 2647, 2720, 2723).
    bool test_m1_modsqrt_p1mod4_tonelli_multi_outer(void) {
        WriteFmt("Testing IntModSqrt Tonelli multi-outer (p=97,a=3)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the loop counters (i, j) and the m contraction across iterations.
    bool test_m1_modsqrt_p1mod4_tonelli_deepest(void) {
        WriteFmt("Testing IntModSqrt Tonelli deepest (p=257,a=2,m=8)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // p = 13 -> q=3, m=2. a = 10 -> root 6 or 7 (both square to 10 mod 13).
    bool test_m1_modsqrt_p1mod4_tonelli_shallow(void) {
        WriteFmt("Testing IntModSqrt Tonelli (p=13,a=10,m=2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Kills the Jacobi guard reached before the Tonelli machinery (2471).
    bool test_m1_modsqrt_p1mod4_nonresidue_preserves_result(void) {
        WriteFmt("Testing IntModSqrt p==1 mod 4 non-residue (p=13,a=2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_zero_value_sets_result_zero(void) {
        WriteFmt("Testing IntModSqrt value 0 sets result 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // reduction (2441) feeding the a==0 fast path.
    bool test_m1_modsqrt_multiple_of_modulus_sets_zero(void) {
        WriteFmt("Testing IntModSqrt 21 mod 7 -> root 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_modulus_two_sets_result(void) {
        WriteFmt("Testing IntModSqrt modulus 2 (a=5 -> root 1)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_even_modulus_fails(void) {
        WriteFmt("Testing IntModSqrt even modulus 8 fails\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Kills the !prime guard / prime detection at lines 2458, 2464.
    bool test_m1_modsqrt_composite_modulus_fails(void) {
        WriteFmt("Testing IntModSqrt composite modulus 9 fails\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_zero_modulus_fails_preserves_result(void) {
        WriteFmt("Testing IntModSqrt zero modulus fails\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m1_modsqrt_value_reduced_before_root(void) {
        WriteFmt("Testing IntModSqrt reduces value first (23 mod 7)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m10_mul_large_product(void) {
        WriteFmt("Testing int_mul large product correctness\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m10_mul_zero_result(void) {
        WriteFmt("Testing int_mul zero operand\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m10_mul_null_result_deadend(void) {
        WriteFmt("Testing int_mul NULL result validation\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m11_pow_u64_contract(void) {
        WriteFmt("Testing int_pow_u64 base^exponent contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // different, distinguishable outcome.
    bool test_m13_gcd_null_result(void) {
        WriteFmt("Testing IntGCD NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // caller-observable.
    bool test_m13_gcd_null_a(void) {
        WriteFmt("Testing IntGCD NULL a handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // LOG_FATAL abort.
    bool test_m13_gcd_null_b(void) {
        WriteFmt("Testing IntGCD NULL b handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // and IntIsZero re-validates modulus, all aborting identically.)
    bool test_m13_modadd_null_result(void) {
        WriteFmt("Testing IntModAdd NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m14_mod_mul_null_result_deadend(void) {
        WriteFmt("Testing IntModMul NULL result validation\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // caller-observable difference diverges (3 vs 5).
    bool test_m15_sub_borrow_propagates(void) {
        WriteFmt("Testing IntSub borrow propagation across bits\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateInt on both, so only the result validation is uniquely observable.)
    bool test_m15_sub_null_result(void) {
        WriteFmt("Testing IntSub NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // crashes.
    bool test_m15_div_u64_rem_null_quotient(void) {
        WriteFmt("Testing int_div_u64_rem NULL quotient handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // removed the NULL dividend reaches IntAllocator(NULL) and crashes.
    bool test_m15_div_u64_rem_null_dividend(void) {
        WriteFmt("Testing int_div_u64_rem NULL dividend handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the int_replace void-call is stripped.
    bool test_m16_lcm_zero_operand_replaces_result(void) {
        WriteFmt("Testing IntLCM zero-operand zeroes result\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // on real code and fails under the mutant.
    bool test_m18_perfect_power_max_degree_only(void) {
        WriteFmt("Testing IntIsPerfectPower hits exponent == max_degree (32 = 2^5)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // downstream via int_div_mod / IntIsZero, so they are not tested here.)
    bool test_m18_div_exact_null_result(void) {
        WriteFmt("Testing int_div_exact NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // string guards the per-bit sum/carry loop.
    bool test_m19_add_carry_chain(void) {
        WriteFmt("Testing int_add carry propagation\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (lines 1712/1713) leaves the stale value and fails the assertion.
    static bool test_m2_root_rem_zero_value_resets_outputs(void) {
        WriteFmt("Testing IntRootRem zero-value resets both outputs\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // root. Also exercises the loop midpoint shift (1766).
    static bool test_m2_root_rem_perfect_square_large(void) {
        WriteFmt("Testing IntRootRem 10000^(1/2) == 100 exact\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // further constrain the high_shift bit-length math and the binary search.
    static bool test_m2_root_rem_perfect_cube(void) {
        WriteFmt("Testing IntRootRem 1000^(1/3) == 10 exact\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the midpoint/compare path produces a wrong root or remainder.
    static bool test_m2_root_rem_nonperfect_cube_remainder(void) {
        WriteFmt("Testing IntRootRem 1001^(1/3) == 10 rem 1\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // search to settle one below 10 and validates the remainder subtraction path.
    static bool test_m2_root_rem_just_below_perfect_cube(void) {
        WriteFmt("Testing IntRootRem 999^(1/3) == 9 rem 270\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 1000000^(1/4): 31^4=923521, 32^4=1048576 -> root 31, rem 1000000-923521=76479.
    static bool test_m2_root_rem_fourth_root_large(void) {
        WriteFmt("Testing IntRootRem 1000000^(1/4) == 31 rem 76479\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //    exponent the real code must take the int_pow_u64 path and return true.
    bool test_m22_pow_int_exponent_value(void) {
        WriteFmt("Testing IntPow with an Int exponent (small, exact value)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exponent through IntToU64) and not return the clean false.
    bool test_m22_pow_int_exponent_too_large(void) {
        WriteFmt("Testing IntPow rejects an exponent that overflows u64\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //    leaves the quotient uncomputed or forces the wrong return value.
    bool test_m22_div_i64_positive_divisor(void) {
        WriteFmt("Testing int_div_i64 with a positive divisor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // wrongly skip the failure branch and attempt a division).
    bool test_m22_div_i64_negative_divisor_fails(void) {
        WriteFmt("Testing int_div_i64 rejects a negative divisor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //    `bool ok = int_div_exact(...)`.
    bool test_m22_div_exact_i64_positive_divisor(void) {
        WriteFmt("Testing int_div_exact_i64 with an exact positive divisor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // anchoring the "forced true" direction of the line 1521 mutant.
    bool test_m22_div_exact_i64_negative_divisor_fails(void) {
        WriteFmt("Testing int_div_exact_i64 rejects a negative divisor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m24_from_u64_roundtrip(void) {
        WriteFmt("Testing IntFrom(5u) round-trip and bit length\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // stored value or trips the allocation guard).
    bool test_m24_from_u64_value_one(void) {
        WriteFmt("Testing IntFrom(1u) round-trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m25_mul_i64_positive(void) {
        WriteFmt("Testing int_mul_i64 with positive scalar\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m25_mul_i64_zero(void) {
        WriteFmt("Testing int_mul_i64 with zero scalar\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m25_pow_i64_positive(void) {
        WriteFmt("Testing int_pow_i64 with positive exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m25_pow_i64_zero(void) {
        WriteFmt("Testing int_pow_i64 with zero exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m25_div_u64_value(void) {
        WriteFmt("Testing int_div_u64 quotient\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_div_exact_u64_returns_true_and_quotient(void) {
        WriteFmt("Testing int_div_exact_u64 success contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_div_mod_u64_returns_and_computes(void) {
        WriteFmt("Testing int_div_mod_u64 success contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_div_mod_i64_returns_and_computes(void) {
        WriteFmt("Testing int_div_mod_i64 success contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_mod_i64_into_value_and_return(void) {
        WriteFmt("Testing int_mod_i64_into success contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_pow_i64_mod_positive_exponent(void) {
        WriteFmt("Testing int_pow_i64_mod positive exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_pow_i64_mod_zero_exponent(void) {
        WriteFmt("Testing int_pow_i64_mod zero exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m26_root_value(void) {
        WriteFmt("Testing IntRoot success contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code returns false cleanly; the mutant crashes -> distinguishable.
    bool test_m27_is_odd_zero_no_abort(void) {
        WriteFmt("Testing IntIsOdd(0) returns false without aborting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_mod_u64_into_computes_remainder(void) {
        WriteFmt("Testing int_mod_u64_into remainder (init-const guard)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_trailing_zero_invalid_deadend(void) {
        WriteFmt("Testing IntTrailingZeroCount validation on invalid Int\n");
    
        Int invalid = {0};
    ///
    bool test_m29_jacobi_error_flag_success_and_failure(void) {
        WriteFmt("Testing IntJacobiWithError error flag both directions\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
     */
    bool test_m3_mod_inv_success_sets_ok(void) {
        WriteFmt("Testing IntModInv returns true on a valid inverse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
     */
    bool test_m3_mod_inv_negative_t_branch(void) {
        WriteFmt("Testing IntModInv negative-coefficient normalization returns true\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (42). The quotient is left unchanged on failure.
    bool test_fe_1487_div_u64_zero_returns_false(void) {
        WriteFmt("Testing IntDiv u64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_fe_1500_div_i64_zero_returns_false(void) {
        WriteFmt("Testing IntDiv i64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // divisible by 10, so real code returns false, mutant returns true.
    bool test_fe_1513_div_exact_u64_inexact_false(void) {
        WriteFmt("Testing IntDivExact u64 inexact return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_fe_1526_div_exact_i64_inexact_false(void) {
        WriteFmt("Testing IntDivExact i64 inexact return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // faithful mutant yields 42 (truthy). Observe the return value.
    bool test_fe_1539_div_mod_u64_zero_returns_false(void) {
        WriteFmt("Testing IntDivMod u64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_fe_1552_div_mod_i64_zero_returns_false(void) {
        WriteFmt("Testing IntDivMod i64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // false; the faithful mutant yields 42 (truthy). Observe the return value.
    bool test_fe_1606_mod_u64_zero_returns_false(void) {
        WriteFmt("Testing IntMod u64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_fe_1614_mod_i64_zero_returns_false(void) {
        WriteFmt("Testing IntMod i64 zero-divisor return value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant returns a wrong (too small) root.
    bool test_fe_1730_root_rem_large_value(void) {
        WriteFmt("Testing IntRootRem bit-length derived bound (large value)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (3/7) reduces through the both-3-mod-4 reciprocity flip to -1.
    bool test_fe_1986_jacobi_reciprocity_sign(void) {
        WriteFmt("Testing IntJacobi reciprocity sign flip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // iterates. sqrt(2) mod 17 = 6 (6^2 = 36 = 2 mod 17).
    bool test_fe_2596_mod_sqrt_tonelli_inner(void) {
        WriteFmt("Testing IntModSqrt Tonelli-Shanks inner loop\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_one_not_prime(void) {
        WriteFmt("Testing IntIsProbablePrime(1) == false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_two_is_prime(void) {
        WriteFmt("Testing IntIsProbablePrime(2) == true\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_four_not_prime(void) {
        WriteFmt("Testing IntIsProbablePrime(4) == false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_three_is_prime(void) {
        WriteFmt("Testing IntIsProbablePrime(3) == true\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_prime_97(void) {
        WriteFmt("Testing IntIsProbablePrime(97) == true (deep witness loop)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_composite_561(void) {
        WriteFmt("Testing IntIsProbablePrime(561) == false (Carmichael)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_composite_1763(void) {
        WriteFmt("Testing IntIsProbablePrime(1763 = 41*43) == false (reaches MR)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_spsp_1373653_composite(void) {
        WriteFmt("Testing IntIsProbablePrime(1373653) == false (SPSP base 2,3)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_large_prime(void) {
        WriteFmt("Testing IntIsProbablePrime(1000000007) == true\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_error_flag_cleared(void) {
        WriteFmt("Testing IntIsProbablePrime clears the error flag\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m5_div_mod_large_correct(void) {
        WriteFmt("Testing int_div_mod large-value correctness\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m5_div_mod_known_quot_rem(void) {
        WriteFmt("Testing int_div_mod 1000000007 / 97\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m5_div_mod_exact_zero_remainder(void) {
        WriteFmt("Testing int_div_mod exact division remainder == 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m5_div_mod_dividend_smaller(void) {
        WriteFmt("Testing int_div_mod dividend < divisor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m5_div_mod_by_zero_returns_false(void) {
        WriteFmt("Testing int_div_mod division by zero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m6_pow_mod_acc_reduction_mod_one(void) {
        WriteFmt("Testing int_pow_mod acc=1 mod 1 reduction\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m6_pow_mod_mod_one_nonzero_exp(void) {
        WriteFmt("Testing int_pow_mod x^e mod 1 == 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m6_pow_mod_known_vector(void) {
        WriteFmt("Testing int_pow_mod 3^13 mod 497\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m6_pow_mod_no_internal_leak(void) {
        WriteFmt("Testing int_pow_mod frees internal temporaries\n");
    
        DebugAllocator dbg = DebugAllocatorInit();
    ///
    bool test_m7_next_prime_of_zero_is_two(void) {
        WriteFmt("Testing IntNextPrime(0) == 2\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m7_next_prime_of_ten_is_eleven(void) {
        WriteFmt("Testing IntNextPrime(10) == 11\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m7_next_prime_of_nine_is_eleven(void) {
        WriteFmt("Testing IntNextPrime(9) == 11\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m7_next_prime_null_result(void) {
        WriteFmt("Testing IntNextPrime(NULL result) aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // returning false, so both the return value and the magnitude diverge.
    bool test_m8_modsub_ge_branch_subtracts(void) {
        WriteFmt("Testing IntModSub a>=b branch performs real subtraction\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // result validation is uniquely caller-observable here.)
    bool test_m8_modsub_null_result(void) {
        WriteFmt("Testing IntModSub NULL result handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 3^13 mod 17 = 12 (3^8=16, 3^4=13, 3^1=3; 16*13*3 mod 17 = 12).
    bool test_m9_pow_u64_mod_known_value(void) {
        WriteFmt("Testing int_pow_u64_mod known value 3^13 mod 17\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // initial acc = (1 mod m) reduction path produces 1 for m > 1.
    bool test_m9_pow_u64_mod_exponent_zero(void) {
        WriteFmt("Testing int_pow_u64_mod exponent zero -> 1\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 2^64 = 18446744073709551616; 18446744073709551616 mod 1000000007 = 582344008.
    bool test_m9_pow_u64_mod_large_modulus(void) {
        WriteFmt("Testing int_pow_u64_mod 2^64 mod 1000000007\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateInt(result) at line 2170: NULL result aborts before any work.
    bool test_m9_pow_u64_mod_null_result(void) {
        WriteFmt("Testing int_pow_u64_mod NULL result aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateInt(base) at line 2171: NULL base aborts before any work.
    bool test_m9_pow_u64_mod_null_base(void) {
        WriteFmt("Testing int_pow_u64_mod NULL base aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateInt(modulus) at line 2172: NULL modulus aborts before any work.
    bool test_m9_pow_u64_mod_null_modulus(void) {
        WriteFmt("Testing int_pow_u64_mod NULL modulus aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Int.Math tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_int_from_unsigned_integer(void) {
        WriteFmt("Testing IntFrom with unsigned integer\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_bytes_le_round_trip(void) {
        WriteFmt("Testing Int little-endian byte conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_bytes_be_round_trip(void) {
        WriteFmt("Testing Int big-endian byte conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_binary_round_trip(void) {
        WriteFmt("Testing Int binary round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_decimal_round_trip(void) {
        WriteFmt("Testing Int decimal round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_radix_round_trip(void) {
        WriteFmt("Testing Int radix conversion round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_upper_hex_radix(void) {
        WriteFmt("Testing Int uppercase radix conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_to_str_allocator_inheritance(void) {
        WriteFmt("Testing IntTryToStr allocator behavior\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_compare_ignores_leading_zeros(void) {
        WriteFmt("Testing IntCompare leading-zero normalization\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_zero_binary(void) {
        WriteFmt("Testing Int zero binary conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_binary_prefix_and_separators(void) {
        WriteFmt("Testing Int binary prefix and separators\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_octal_round_trip(void) {
        WriteFmt("Testing Int octal round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_hex_round_trip(void) {
        WriteFmt("Testing Int hex round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_binary_invalid_digit(void) {
        WriteFmt("Testing IntFromBinary invalid digit handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_decimal_invalid_digit(void) {
        WriteFmt("Testing IntFromStr invalid digit handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_hex_invalid_digit(void) {
        WriteFmt("Testing IntFromHexStr invalid digit handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_radix_invalid_digit(void) {
        WriteFmt("Testing IntFromStrRadix invalid digit handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_radix_invalid_radix(void) {
        WriteFmt("Testing IntFromStrRadix invalid radix handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_to_u64_overflow(void) {
        WriteFmt("Testing IntToU64 overflow handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_to_str_radix_invalid_radix(void) {
        WriteFmt("Testing IntToStrRadix invalid radix handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_binary_null(void) {
        WriteFmt("Testing IntFromBinary NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_from_binary_null(void) {
        WriteFmt("Testing IntTryFromBinary NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_decimal_null(void) {
        WriteFmt("Testing IntFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_from_decimal_null(void) {
        WriteFmt("Testing IntTryFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_radix_null(void) {
        WriteFmt("Testing IntFromStrRadix NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_from_radix_null(void) {
        WriteFmt("Testing IntTryFromStrRadix NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_octal_null(void) {
        WriteFmt("Testing IntFromOctStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_from_octal_null(void) {
        WriteFmt("Testing IntTryFromOctStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_hex_null(void) {
        WriteFmt("Testing IntFromHexStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_try_from_hex_null(void) {
        WriteFmt("Testing IntTryFromHexStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_from_bytes_le_null(void) {
        WriteFmt("Testing IntFromBytesLE NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_to_bytes_le_null(void) {
        WriteFmt("Testing IntToBytesLE NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_to_bytes_be_zero_max_len(void) {
        WriteFmt("Testing IntToBytesBE zero max_len handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m10_mul_sparse_bits(void) {
        WriteFmt("Testing int_mul sparse-bit multiplier\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m12_radix_underscore_only_rejected(void) {
        WriteFmt("Testing IntTryFromStrRadix rejects underscore-only input\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m12_radix_valid_digit_parses(void) {
        WriteFmt("Testing IntTryFromStrRadix accepts a valid digit run\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m12_radix_invalid_radix_rejected(void) {
        WriteFmt("Testing IntTryFromStrRadix radix-range gate\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_binary_prefix_lower(void) {
        WriteFmt("Testing int_try_from_binary_str 0b-prefixed lowercase\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_binary_prefix_upper(void) {
        WriteFmt("Testing int_try_from_binary_str 0B-prefixed uppercase\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_binary_no_prefix(void) {
        WriteFmt("Testing int_try_from_binary_str non-prefixed\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_oct_prefix_lower(void) {
        WriteFmt("Testing int_try_from_oct_str_str 0o-prefixed lowercase\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_oct_prefix_upper(void) {
        WriteFmt("Testing int_try_from_oct_str_str 0O-prefixed uppercase\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m17_oct_no_prefix(void) {
        WriteFmt("Testing int_try_from_oct_str_str non-prefixed\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // strings below for several magnitudes (single digit, multi digit, large).
    bool test_m19_to_str_radix_roundtrip(void) {
        WriteFmt("Testing int_try_to_str_radix digit extraction\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // round-trip parse->serialize equality guards the in-place multiply path.
    bool test_m19_from_str_radix_mul_chain(void) {
        WriteFmt("Testing int_mul_u64_in_place via radix parse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // result (parse failure -> we observe a non-true return / wrong magnitude).
    bool test_m20_radix_digit_uppercase_bounds(void) {
        WriteFmt("Testing int_radix_digit uppercase boundary chars (radix 36 \"AZ\")\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code yields 255; both mutants diverge (wrong value or parse failure).
    bool test_m20_radix_digit_uppercase_value(void) {
        WriteFmt("Testing int_radix_digit uppercase value math (radix 16 \"FF\")\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // path, so this test isolates the init-const mutant.)
    bool test_m20_from_str_str_no_sign(void) {
        WriteFmt("Testing int_try_from_str_str start offset with no sign (Str \"123\")\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // value), a distinguishable caller-observable outcome.
    bool test_m20_from_str_str_plus_sign(void) {
        WriteFmt("Testing int_try_from_str_str leading '+' handling (Str \"+5\")\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_radix_str_basic(void) {
        WriteFmt("Testing int_try_from_str_radix_str basic decimal parse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_radix_str_plus_sign(void) {
        WriteFmt("Testing int_try_from_str_radix_str leading plus sign\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_to_bytes_le_count(void) {
        WriteFmt("Testing IntToBytesLE writes exact byte count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_to_bytes_le_single(void) {
        WriteFmt("Testing IntToBytesLE single-byte value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_to_bytes_be_count(void) {
        WriteFmt("Testing IntToBytesBE writes exact byte count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    bool test_m21_to_bytes_be_single(void) {
        WriteFmt("Testing IntToBytesBE single-byte value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code skips the leading '+' and parses 5.
    bool test_m22_from_str_zstr_leading_plus(void) {
        WriteFmt("Testing int_try_from_str_zstr skips a leading '+'\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // '+' mutants above are isolated to the sign-skip behaviour.
    bool test_m22_from_str_zstr_no_sign(void) {
        WriteFmt("Testing int_try_from_str_zstr parses a plain decimal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // hits '+' as a digit and fails.
    bool test_m23_radix_zstr_plus_sign_skipped(void) {
        WriteFmt("Testing int_try_from_str_radix_zstr leading-plus\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant would parse only "7" == 7.
    bool test_m23_oct_zstr_no_prefix_parses_all(void) {
        WriteFmt("Testing int_try_from_oct_str_zstr no-prefix\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // to 2 and the mutant parses only "7" == 7.
    bool test_m23_oct_zstr_leading_zero_not_prefix(void) {
        WriteFmt("Testing int_try_from_oct_str_zstr leading-zero-not-prefix\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // byte[0]; the real hash distinguishes them, the mutant collapses them.
    bool test_m23_hash_uses_all_bytes(void) {
        WriteFmt("Testing int_hash mixes every byte\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m24_from_bytes_be_null_zero(void) {
        WriteFmt("Testing IntFromBytesBE(NULL, 0) -> 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // constructed magnitude is exact.
    bool test_m24_from_bytes_be_roundtrip(void) {
        WriteFmt("Testing IntFromBytesBE big-endian accumulation\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m24_binary_reject_nonbinary_prefix(void) {
        WriteFmt("Testing IntTryFromBinary rejects \"0c1\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // prefix branch is still taken for real 'b' prefixes.
    bool test_m24_binary_accept_real_prefix(void) {
        WriteFmt("Testing IntTryFromBinary accepts \"0b101\" -> 5\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code returns a zero Int cleanly; the mutant crashes -> distinguishable.
    bool test_m27_from_bytes_le_null_zero_no_abort(void) {
        WriteFmt("Testing IntFromBytesLE(NULL, 0) yields zero without aborting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code: value 5, IntBitLength == 3; mutant: IntBitLength == 16.
    bool test_m27_from_bytes_le_trailing_zero_normalized(void) {
        WriteFmt("Testing IntFromBytesLE normalizes trailing zero bytes\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_from_str_str_parses(void) {
        WriteFmt("Testing int_from_str_str parses Str decimal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_from_str_radix_str_parses(void) {
        WriteFmt("Testing int_from_str_radix_str parses Str hex\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m29_hex_str_str_return_valid_and_value(void) {
        WriteFmt("Testing int_try_from_hex_str_str valid return + value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m29_hex_str_str_return_invalid(void) {
        WriteFmt("Testing int_try_from_hex_str_str invalid return\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // {0x01, 0x02}; the mutant leaves {0x00, 0x00}.
    bool test_fe_603_to_bytes_be_content(void) {
        WriteFmt("Testing IntToBytesBE big-endian content\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Int.Convert tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_int_bit_length(void) {
        WriteFmt("Testing IntBitLength\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_byte_length(void) {
        WriteFmt("Testing IntByteLength\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_zero(void) {
        WriteFmt("Testing IntIsZero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_one(void) {
        WriteFmt("Testing IntIsOne\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_parity(void) {
        WriteFmt("Testing Int parity helpers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_fits_u64(void) {
        WriteFmt("Testing IntFitsU64\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_log2(void) {
        WriteFmt("Testing IntLog2\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_trailing_zero_count(void) {
        WriteFmt("Testing IntTrailingZeroCount\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_is_power_of_two(void) {
        WriteFmt("Testing IntIsPowerOfTwo\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_int_log2_zero(void) {
        WriteFmt("Testing IntLog2 zero handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the int_replace removals (1725/1726).
    static bool test_m2_root_rem_degree_one_clones_value(void) {
        WriteFmt("Testing IntRootRem degree==1 clones value, zero remainder\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // hash equals the offset basis exactly.
    bool test_m23_hash_zero_is_fnv_offset_basis(void) {
        WriteFmt("Testing int_hash zero == FNV offset basis\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (0x83 ^ 0xFF != 0x83 | 0xFF) so the digest diverges.
    bool test_m23_hash_xor_not_or(void) {
        WriteFmt("Testing int_hash folds bytes with XOR\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Replacing the call with a constant scalar (false/0) is observable.
    bool test_m23_shift_right_zero_is_noop_true(void) {
        WriteFmt("Testing IntShiftRight by zero positions\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_m24_shift_left_zero_noop(void) {
        WriteFmt("Testing IntShiftLeft(&v, 0) returns true, value unchanged\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_bit_counts_known_value(void) {
        WriteFmt("Testing significant-bits and trailing-zero counts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    static bool test_m28_bit_length_invalid_deadend(void) {
        WriteFmt("Testing IntBitLength validation on invalid Int\n");
    
        Int invalid = {0};
    // 7^20 mod 13 = 3.
    bool test_m9_pow_u64_mod_multibit_exponent(void) {
        WriteFmt("Testing int_pow_u64_mod multi-bit exponent 7^20 mod 13\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Int.Access tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_user_type_write_basic(void) {
        WriteFmt("Testing user-type write through IOFMT_USER_CASE_\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_user_type_write_mixed_args(void) {
        WriteFmt("Testing user-type mixed with in-tree types\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_user_type_read_basic(void) {
        WriteFmt("Testing user-type read through IOFMT_USER_CASE_\n");
    
        Zstr    in = "(42, -9)";
    
    bool test_user_type_round_trip(void) {
        WriteFmt("Testing user-type write/read round-trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_nested_user_type_write(void) {
        WriteFmt("Testing user-type-in-user-type writer (Bounds embeds Point2D)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_nested_user_type_round_trip(void) {
        WriteFmt("Testing nested user-type round-trip (Bounds)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_deep_nested_user_type_write(void) {
        WriteFmt("Testing 3-level nested user-type writer (Region -> Bounds -> Point2D)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_deep_nested_user_type_round_trip(void) {
        WriteFmt("Testing 3-level nested user-type round-trip (Region)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_nested_user_type_mixed_with_builtins(void) {
        WriteFmt("Testing nested user types mixed with built-ins in one call\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Io.UserTypes tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_basic_formatting(void) {
        WriteFmt("Testing basic formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_string_formatting(void) {
        WriteFmt("Testing string formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_integer_decimal_formatting(void) {
        WriteFmt("Testing integer decimal formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_integer_hex_formatting(void) {
        WriteFmt("Testing integer hexadecimal formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_integer_binary_formatting(void) {
        WriteFmt("Testing integer binary formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_integer_octal_formatting(void) {
        WriteFmt("Testing integer octal formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_basic_formatting(void) {
        WriteFmt("Testing basic floating point formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_precision_formatting(void) {
        WriteFmt("Testing floating point precision formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_special_values(void) {
        WriteFmt("Testing special floating point values\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_width_alignment_formatting(void) {
        WriteFmt("Testing width and alignment formatting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_multiple_arguments(void) {
        WriteFmt("Testing multiple arguments\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_char_formatting(void) {
        WriteFmt("Testing character formatting specifiers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_bitvec_formatting(void) {
        WriteFmt("Testing BitVec formatting\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_int_formatting(void) {
        WriteFmt("Testing Int formatting\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_float_formatting(void) {
        WriteFmt("Testing Float formatting\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_buf_formatting(void) {
        WriteFmt("Testing Buf formatting\n");
    
        DefaultAllocator alloc  = DefaultAllocatorInit();
    bool test_char_nonprintable_escape(void);
    bool test_char_nonprintable_escape(void) {
        WriteFmt("Testing {c} escaping of non-printable bytes\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    bool test_buf_raw_endianness_and_roundtrip(void);
    bool test_buf_raw_endianness_and_roundtrip(void) {
        WriteFmt("Testing Buf raw {<Nr}/{>Nr} byte order + read-back round-trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //         and aborts at the width-mismatch LOG_FATAL.
    static bool test_m16_u8_roundtrip(void) {
        WriteFmt("m16: u8 width-1 round-trip\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    //         and aborts at the width-mismatch LOG_FATAL.
    static bool test_m16_u32_roundtrip(void) {
        WriteFmt("m16: u32 width-4 round-trip\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    //         LOG_FATAL instead of resolving var_width = 8.
    static bool test_m16_u64_roundtrip(void) {
        WriteFmt("m16: u64 width-8 round-trip\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    //         type" LOG_FATAL instead of resolving var_width = 8.
    static bool test_m16_i64_roundtrip(void) {
        WriteFmt("m16: i64 width-8 round-trip\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    // ---------------------------------------------------------------------------
    static bool test_m16_nonraw_spec_deadend(void) {
        WriteFmt("m16: non-raw spec {2} must abort\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    // the f64 is overwritten -> assertion below fires.
    static bool test_m2_bare_prefix_0x_rejected(void) {
        WriteFmt("[m2] bare prefix 0x must be rejected by float validator\n");
    
        f64  v = SENTINEL;
    // surviving case is still caught.
    static bool test_m2_bare_prefix_0b_rejected(void) {
        WriteFmt("[m2] bare prefix 0b must be rejected by float validator\n");
    
        f64  v = SENTINEL;
    
    static bool test_m2_bare_prefix_0o_rejected(void) {
        WriteFmt("[m2] bare prefix 0o must be rejected by float validator\n");
    
        f64  v = SENTINEL;
    //   * Real code sets is_hex, accepts, StrToF64 -> 0.0.
    static bool test_m2_hex_prefix_upper_X_accepted(void) {
        WriteFmt("[m2] 0X1F hex slice must be accepted (-> 0.0)\n");
    
        f64  v = SENTINEL;
    // to `!= 'B'` -> is_bin never set -> 'B' rejected -> v stays sentinel.
    static bool test_m2_bin_prefix_upper_B_accepted(void) {
        WriteFmt("[m2] 0B11 binary slice must be accepted (-> 0.0)\n");
    
        f64  v = SENTINEL;
    // to `!= 'O'` -> is_oct never set -> 'O' rejected -> v stays sentinel.
    static bool test_m2_oct_prefix_upper_O_accepted(void) {
        WriteFmt("[m2] 0O7 octal slice must be accepted (-> 0.0)\n");
    
        f64  v = SENTINEL;
    // input) and keep the sentinel/zero machinery honest.
    static bool test_m2_plain_float_roundtrips(void) {
        WriteFmt("[m2] plain float 12.5 still parses\n");
    
        f64  v = SENTINEL;
    
    static bool test_m2_lowercase_hex_prefix_accepted(void) {
        WriteFmt("[m2] 0x1f hex slice accepted (-> 0.0), guards 'x' operand\n");
    
        f64  v = SENTINEL;
    // pointer is left unmoved -- so a fully-consumed cursor distinguishes them.
    bool test_m20_float_token_boundary(void) {
        WriteFmt("m20: Float token boundary cursor\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // value.
    bool test_m20_float_token_boundary_no_trailer(void) {
        WriteFmt("m20: Float token boundary, whole input\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // boundary and breaks the literal match.
    bool test_m20_float_scientific_boundary(void) {
        WriteFmt("m20: Float scientific token boundary\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // expected value after a successful read.
    bool test_m20_float_value_exact(void) {
        WriteFmt("m20: Float value exact\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    //                            "12.000".
    bool test_m25_nodot_precision_pads_zeros(void) {
        WriteFmt("m25: no-dot integer, precision pads trailing zeros\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    //   line 1368 precision>0 : gt_to_ge makes it true at precision==0 -> "12.".
    bool test_m25_nodot_precision_zero_no_dot(void) {
        WriteFmt("m25: no-dot integer, precision 0 yields no dot\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    //                          `precision`, so the test cannot produce "1.500".
    bool test_m25_dot_precision_pads_zeros(void) {
        WriteFmt("m25: with-dot fraction, precision pads trailing zeros\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    //   line 1390 precision>0 : gt_to_ge makes it true at precision==0 -> "1.".
    bool test_m25_dot_precision_zero_truncates_dot(void) {
        WriteFmt("m25: with-dot fraction, precision 0 drops fraction\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // Pins the prefix/frac span computation and the MIN2 truncation.
    bool test_m25_dot_precision_truncates_fraction(void) {
        WriteFmt("m25: with-dot fraction, precision truncates\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // one arg: the second field trips the guard.
    static bool test_deadend_bufread_too_few_args(void) {
        WriteFmt("bufread too-few-args must abort\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Buf              b     = BufInit(&alloc);
    
    int main(void) {
        WriteFmt("[INFO] Starting format writer tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_integer_decimal_reading(void) {
        WriteFmt("Testing integer decimal reading\n");
    
        Zstr z = NULL;
    
    bool test_integer_hex_reading(void) {
        WriteFmt("Testing integer hexadecimal reading\n");
    
        Zstr z = NULL;
    
    bool test_integer_binary_reading(void) {
        WriteFmt("Testing integer binary reading\n");
    
        Zstr z = NULL;
    
    bool test_integer_octal_reading(void) {
        WriteFmt("Testing integer octal reading\n");
    
        Zstr z = NULL;
    
    bool test_float_basic_reading(void) {
        WriteFmt("Testing basic float reading\n");
    
        Zstr z = NULL;
    
    bool test_float_scientific_reading(void) {
        WriteFmt("Testing scientific notation reading\n");
    
        Zstr z = NULL;
    
    bool test_string_reading(void) {
        WriteFmt("Testing string reading\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_multiple_arguments_reading(void) {
        WriteFmt("Testing multiple arguments reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // destination variable is left at its pre-read value on parse failure.
    bool test_error_handling_reading(void) {
        WriteFmt("Testing error handling for reading\n");
    
        Zstr z = NULL;
    
    bool test_character_ordinal_reading(void) {
        WriteFmt("Testing character ordinal reading with :c format specifier\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        z         = "A";
        StrReadFmt(z, "{c}", u8_val);
        WriteFmt("u8_val = {}, expected = {}, pass = {}\n", u8_val, 'A', (u8_val == 'A') ? "true" : "false");
        success = success && (u8_val == 'A');
        z      = "z";
        StrReadFmt(z, "{c}", u8_val);
        WriteFmt("u8_val = {}, expected = {}, pass = {}\n", u8_val, 'z', (u8_val == 'z') ? "true" : "false");
        success = success && (u8_val == 'z');
        z         = "B";
        StrReadFmt(z, "{c}", i8_val);
        WriteFmt("i8_val = {}, expected = {}, pass = {}\n", i8_val, 'B', (i8_val == 'B') ? "true" : "false");
        success = success && (i8_val == 'B');
        z           = "C";
        StrReadFmt(z, "{c}", i16_val);
        WriteFmt("i16_val = {}, expected = {}, pass = {}\n", i16_val, 'C', (i16_val == 'C') ? "true" : "false");
        success = success && (i16_val == 'C');
        z           = "D";
        StrReadFmt(z, "{c}", i32_val);
        WriteFmt("i32_val = {}, expected = {}, pass = {}\n", i32_val, 'D', (i32_val == 'D') ? "true" : "false");
        success = success && (i32_val == 'D');
        z           = "E";
        StrReadFmt(z, "{c}", i64_val);
        WriteFmt("i64_val = {}, expected = {}, pass = {}\n", i64_val, 'E', (i64_val == 'E') ? "true" : "false");
        success = success && (i64_val == 'E');
        z           = "F";
        StrReadFmt(z, "{c}", u16_val);
        WriteFmt("u16_val = {}, expected = {}, pass = {}\n", u16_val, 'F', (u16_val == 'F') ? "true" : "false");
        success = success && (u16_val == 'F');
        z           = "G";
        StrReadFmt(z, "{c}", u32_val);
        WriteFmt("u32_val = {}, expected = {}, pass = {}\n", u32_val, 'G', (u32_val == 'G') ? "true" : "false");
        success = success && (u32_val == 'G');
        z           = "H";
        StrReadFmt(z, "{c}", u64_val);
        WriteFmt("u64_val = {}, expected = {}, pass = {}\n", u64_val, 'H', (u64_val == 'H') ? "true" : "false");
        success = success && (u64_val == 'H');
        StrReadFmt(z, "{c}", u16_val);
        bool u16_multi_pass = (ZstrCompareN((Zstr)&u16_val, "AB", 2) == 0);
        WriteFmt("u16_val multi-char test: comparing memory with 'AB', pass = {}\n", u16_multi_pass ? "true" : "false");
        WriteFmt(
            "DEBUG: u16_val bytes: [{}, {}], expected 'AB' bytes: [{}, {}]\n",
        bool u16_multi_pass = (ZstrCompareN((Zstr)&u16_val, "AB", 2) == 0);
        WriteFmt("u16_val multi-char test: comparing memory with 'AB', pass = {}\n", u16_multi_pass ? "true" : "false");
        WriteFmt(
            "DEBUG: u16_val bytes: [{}, {}], expected 'AB' bytes: [{}, {}]\n",
            (int)((u8 *)&u16_val)[0],
        StrReadFmt(z, "{c}", i16_val);
        bool i16_multi_pass = (ZstrCompareN((Zstr)&i16_val, "CD", 2) == 0);
        WriteFmt("i16_val multi-char test: comparing memory with 'CD', pass = {}\n", i16_multi_pass ? "true" : "false");
        success = success && i16_multi_pass;
        StrReadFmt(z, "{c}", u32_val);
        bool u32_multi_pass = (ZstrCompareN((Zstr)&u32_val, "EFGH", 4) == 0);
        WriteFmt("u32_val multi-char test: comparing memory with 'EFGH', pass = {}\n", u32_multi_pass ? "true" : "false");
        success = success && u32_multi_pass;
        StrReadFmt(z, "{c}", i32_val);
        bool i32_multi_pass = (ZstrCompareN((Zstr)&i32_val, "IJKL", 4) == 0);
        WriteFmt("i32_val multi-char test: comparing memory with 'IJKL', pass = {}\n", i32_multi_pass ? "true" : "false");
        success = success && i32_multi_pass;
        StrReadFmt(z, "{c}", u64_val);
        bool u64_multi_pass = (ZstrCompareN((Zstr)&u64_val, "MNOPQRST", 8) == 0);
        WriteFmt(
            "u64_val multi-char test: comparing memory with 'MNOPQRST', pass = {}\n",
            u64_multi_pass ? "true" : "false"
        StrReadFmt(z, "{c}", i64_val);
        bool i64_multi_pass = (ZstrCompareN((Zstr)&i64_val, "UVWXYZab", 8) == 0);
        WriteFmt(
            "i64_val multi-char test: comparing memory with 'UVWXYZab', pass = {}\n",
            i64_multi_pass ? "true" : "false"
        StrReadFmt(z, "{c}", f32_val);
        bool f32_pass = (f32_val == (f32)'A');
        WriteFmt("f32_val = {}, expected = {}, pass = {}\n", f32_val, (f32)'A', f32_pass ? "true" : "false");
        success = success && f32_pass;
        StrReadFmt(z, "{c}", f64_val);
        bool f64_pass = (f64_val == (f64)'B');
        WriteFmt("f64_val = {}, expected = {}, pass = {}\n", f64_val, (f64)'B', f64_pass ? "true" : "false");
        success = success && f64_pass;
        StrReadFmt(z, "{c}", u8_val);
        bool tilde_pass = (u8_val == '~');
        WriteFmt("u8_val = {}, expected = {} (~), pass = {}\n", u8_val, '~', tilde_pass ? "true" : "false");
        success = success && tilde_pass;
        StrReadFmt(z, "{c}", u32_val);
        bool xy_pass = (ZstrCompareN((Zstr)&u32_val, "XY", 2) == 0);
        WriteFmt("u32_val partial test: comparing memory with 'XY', pass = {}\n", xy_pass ? "true" : "false");
        success = success && xy_pass;
        StrReadFmt(z, "{c}", u64_val);
        bool abc_pass = (ZstrCompareN((Zstr)&u64_val, "abc", 3) == 0);
        WriteFmt("u64_val partial test: comparing memory with 'abc', pass = {}\n", abc_pass ? "true" : "false");
        success = success && abc_pass;
        Str  expected = StrInitFromZstr("Hello", &alloc);
        bool str_pass = (StrCmp(&str_val, &expected) == 0);
        WriteFmt("str_val test: comparing with 'Hello', pass = {}\n", str_pass ? "true" : "false");
        success = success && str_pass;
        StrDeinit(&expected);
        expected             = StrInitFromZstr("World", &alloc);
        bool quoted_str_pass = (StrCmp(&str_val, &expected) == 0);
        WriteFmt("quoted str_val test: comparing with 'World', pass = {}\n", quoted_str_pass ? "true" : "false");
        success = success && quoted_str_pass;
        StrDeinit(&expected);
        StrDeinit(&str_val);
    
        WriteFmt("Overall success: {}\n", success ? "true" : "false");
        DefaultAllocatorDeinit(&alloc);
        return success;
    
    bool test_string_case_conversion_reading(void) {
        WriteFmt("Testing string case conversion with :a and :A format specifiers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
            StrReadFmt(z, "{a}", result);
    
            WriteFmt("Test 1 - :a (lowercase)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 1 - :a (lowercase)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "hello" (stops at first space)
            Str  expected   = StrInitFromZstr("hello world", &alloc);
            bool test1_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'hello', Pass: {}\n\n", test1_pass ? "true" : "false");
            success = success && test1_pass;
            StrReadFmt(z, "{as}", result);
    
            WriteFmt("Test 1.1 - :as (lowercase string single word)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 1.1 - :as (lowercase string single word)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "hello" (stops at first space)
            Str  expected   = StrInitFromZstr("hello", &alloc);
            bool test1_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'hello', Pass: {}\n\n", test1_pass ? "true" : "false");
            success = success && test1_pass;
            StrReadFmt(z, "{A}", result);
    
            WriteFmt("Test 2 - :A (uppercase)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 2 - :A (uppercase)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "HELLO" (stops at first space)
            Str  expected   = StrInitFromZstr("HELLO WORLD", &alloc);
            bool test2_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'HELLO', Pass: {}\n\n", test2_pass ? "true" : "false");
            success = success && test2_pass;
            StrReadFmt(z, "{A} {A}", result1, result2);
    
            WriteFmt("Test 2 - :A (uppercase with split format)\n");
            WriteFmt("Input: '{}', Output: '{} {}'", in, result1, result2);
    
            WriteFmt("Test 2 - :A (uppercase with split format)\n");
            WriteFmt("Input: '{}', Output: '{} {}'", in, result1, result2);
    
            bool test2_pass  = (StrCmp(&result1, "HELLO") == 0);
            bool test2_pass  = (StrCmp(&result1, "HELLO") == 0);
            test2_pass      &= (StrCmp(&result2, "WORLD") == 0);
            WriteFmt("Expected: 'HELLO WORLD', Pass: {}\n\n", test2_pass ? "true" : "false");
            success = success && test2_pass;
            // result2 must consume the space after hello and then everything after it
    
            WriteFmt("Test 2 - :A (uppercase with split format)\n");
            WriteFmt("Input: '{}', Output: '{}{}'", in, result1, result2);
    
            WriteFmt("Test 2 - :A (uppercase with split format)\n");
            WriteFmt("Input: '{}', Output: '{}{}'", in, result1, result2);
    
            bool test2_pass  = (StrCmp(&result1, "HELLO") == 0);
            bool test2_pass  = (StrCmp(&result1, "HELLO") == 0);
            test2_pass      &= (StrCmp(&result2, " WORLD MIGHTY MISRA") == 0); // notice the extra space
            WriteFmt("Expected: 'HELLO WORLD MIGHTY MISRA', Pass: {}\n\n", test2_pass ? "true" : "false");
            success = success && test2_pass;
            StrReadFmt(z, "{as}", result);
    
            WriteFmt("Test 3 - :a with quoted string\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 3 - :a with quoted string\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "mixed case" (converts the entire quoted string)
            Str  expected   = StrInitFromZstr("mixed case", &alloc);
            bool test3_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'mixed case', Pass: {}\n\n", test3_pass ? "true" : "false");
            success = success && test3_pass;
            StrReadFmt(z, "{As}", result);
    
            WriteFmt("Test 4 - :A with mixed alphanumeric\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 4 - :A with mixed alphanumeric\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "ABC123XYZ" (only letters are converted, numbers unchanged)
            Str  expected   = StrInitFromZstr("ABC123XYZ", &alloc);
            bool test4_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'ABC123XYZ', Pass: {}\n\n", test4_pass ? "true" : "false");
            success = success && test4_pass;
            StrReadFmt(z, "{c}", result);
    
            WriteFmt("Test 5 - :c (no case conversion)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
    
            WriteFmt("Test 5 - :c (no case conversion)\n");
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            WriteFmt("Input: '{}', Output: '", in);
            for (size i = 0; i < StrLen(&result); i++) {
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result)[i]);
            }
            WriteFmt("'\n");
    
            // Should read "Hello" (stops at first space, no case conversion)
            Str  expected   = StrInitFromZstr("Hello World", &alloc);
            bool test5_pass = (StrCmp(&result, &expected) == 0);
            WriteFmt("Expected: 'Hello World', Pass: {}\n\n", test5_pass ? "true" : "false");
            success = success && test5_pass;
        }
    
        WriteFmt("Overall case conversion success: {}\n", success ? "true" : "false");
        DefaultAllocatorDeinit(&alloc);
        return success;
    
    bool test_bitvec_reading(void) {
        WriteFmt("Testing BitVec reading\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
        Str result1 = BitVecToStr(&bv1);
        success     = success && (ZstrCompare(StrBegin(&result1), "10110") == 0);
        WriteFmt(
            "Test 1 - Binary: {}, Success: {}\n",
            result1,
        u64 value2 = BitVecToInteger(&bv2);
        success    = success && (value2 == 0xDEAD);
        WriteFmt("Test 2 - Hex: {}, Success: {}\n", value2, (value2 == 0xDEAD) ? "true" : "false");
        BitVecDeinit(&bv2);
        u64 value3 = BitVecToInteger(&bv3);
        success    = success && (value3 == 0755);
        WriteFmt("Test 3 - Octal: {}, Success: {}\n", value3, (value3 == 0755) ? "true" : "false");
        BitVecDeinit(&bv3);
        Str result4 = BitVecToStr(&bv4);
        success     = success && (ZstrCompare(StrBegin(&result4), "1101") == 0);
        WriteFmt(
            "Test 4 - Whitespace: {}, Success: {}\n",
            result4,
        Str result5 = BitVecToStr(&bv5);
        success     = success && (ZstrCompare(StrBegin(&result5), "0") == 0);
        WriteFmt(
            "Test 5 - Zero: {}, Success: {}\n",
            result5,
        BitVecDeinit(&bv5);
    
        WriteFmt("Overall BitVec reading success: {}\n", success ? "true" : "false");
        DefaultAllocatorDeinit(&alloc);
        return success;
    
    bool test_int_reading(void) {
        WriteFmt("Testing Int reading\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_float_reading(void) {
        WriteFmt("Testing Float reading\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting format reader tests\n\n");
    
        TestFunction tests[] = {
        bool ok = (ps >= 4096) && ((ps & (ps - 1)) == 0);
        if (!ok) {
            WriteFmt("page size invalid: {}\n", ps);
        }
        return ok;
    
        if (PageAllocatorEntryCount(&alloc) != 0) {
            WriteFmt("init EntryCount != 0\n");
            ok = false;
        }
        }
        if (AllocatorFootprintBytes(&alloc) != 0) {
            WriteFmt("init Footprint != 0\n");
            ok = false;
        }
        void *p2 = AllocatorAlloc(alloc_base, page * 2, true);
        if (!p1 || !p2) {
            WriteFmt("alloc failed\n");
            ok = false;
        }
        }
        if (PageAllocatorEntryCount(&alloc) != 2) {
            WriteFmt("after 2 allocs EntryCount={} want 2\n", (u64)PageAllocatorEntryCount(&alloc));
            ok = false;
        }
        size foot_with_two = AllocatorFootprintBytes(&alloc);
        if (foot_with_two < page + page * 2) {
            WriteFmt("foot_with_two={} want >= {}\n", (u64)foot_with_two, (u64)(page + page * 2));
            ok = false;
        }
        // EntryCount drops to 1 (p1 moved to free_entries[]).
        if (PageAllocatorEntryCount(&alloc) != 1) {
            WriteFmt("after free p1 EntryCount={} want 1\n", (u64)PageAllocatorEntryCount(&alloc));
            ok = false;
        }
        size foot_after_free_p1 = AllocatorFootprintBytes(&alloc);
        if (foot_after_free_p1 < foot_with_two) {
            WriteFmt("foot shrank after retention: {} < {}\n", (u64)foot_after_free_p1, (u64)foot_with_two);
            ok = false;
        }
        }
        if (PageAllocatorEntryCount(&alloc) != 0) {
            WriteFmt("after free p2 EntryCount={} want 0\n", (u64)PageAllocatorEntryCount(&alloc));
            ok = false;
        }
        }
        if (AllocatorFootprintBytes(&alloc) < foot_with_two) {
            WriteFmt("foot shrank after all-free\n");
            ok = false;
        }
        // Post-deinit the struct is zeroed: both accessors return 0.
        if (PageAllocatorEntryCount(&alloc) != 0) {
            WriteFmt("post-deinit EntryCount != 0\n");
            ok = false;
        }
        }
        if (AllocatorFootprintBytes(&alloc) != 0) {
            WriteFmt("post-deinit Footprint != 0\n");
            ok = false;
        }
    // Test string comparison functions
    bool test_str_cmp(void) {
        WriteFmt("Testing StrCmp variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string find functions
    bool test_str_find(void) {
        WriteFmt("Testing StrFind variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string contains/index functions
    bool test_str_contains_index(void) {
        WriteFmt("Testing StrContains and StrIndexOf variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string starts/ends with functions
    bool test_str_starts_ends_with(void) {
        WriteFmt("Testing StrStartsWith and StrEndsWith variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string replace functions
    bool test_str_replace(void) {
        WriteFmt("Testing StrReplace variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string split functions
    bool test_str_split(void) {
        WriteFmt("Testing StrSplit and StrSplitToIters\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test string strip functions
    bool test_str_strip(void) {
        WriteFmt("Testing StrStrip variants\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // with "World" must be true.
    static bool test_str_ends_with_str_true(void) {
        WriteFmt("Testing StrEndsWith reports true on a match and false on a non-match\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // char short and wrongly retains a single strip character.
    static bool test_lstrip_all_strip_chars_empty(void) {
        WriteFmt("Testing StrLStrip drops every strip char\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // empty result; the mutant leaves a single trailing strip character.
    static bool test_rstrip_all_strip_chars_empty(void) {
        WriteFmt("Testing StrRStrip drops every strip char\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `end == start`; intact keeps it (len 1), the mutant drops it (len 0).
    static bool test_strip_single_surviving_char_kept(void) {
        WriteFmt("Testing StrStrip keeps a lone surviving char\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // not a substring must report false via the Str* path.
    static bool test_contains_str_absent_key_false(void) {
        WriteFmt("Testing StrContains(Str*) absent key is false\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // constant replacement.
    static bool test_contains_str_present_and_absent(void) {
        WriteFmt("Testing StrContains(Str*) present vs absent\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // key reports contained. An absent key via the Cstr/Zstr path must be false.
    static bool test_contains_cstr_absent_key_false(void) {
        WriteFmt("Testing StrContains(Zstr) absent key is false\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the intact result has 3 iters (last length 0); the mutant drops it (2).
    static bool test_split_to_iters_trailing_empty_field(void) {
        WriteFmt("Testing StrSplitToIters trailing empty field\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // result to 42 pushes it -> 1 element.
    static bool test_split_drops_prefix_of_key(void) {
        WriteFmt("Testing StrSplit drops a remaining proper-prefix-of-key segment\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (VecLen(&split) == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected 0 split elements, got {}\n", (u64)VecLen(&split));
        }
    // the segment is wrongly pushed.
    static bool test_split_prefix_compare_length(void) {
        WriteFmt("Testing StrSplit prefix-of-key compare uses remaining length\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (VecLen(&split) == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected 0 split elements, got {}\n", (u64)VecLen(&split));
        }
    // it 42.
    static bool test_cmp_zstr_equal(void) {
        WriteFmt("Testing StrCmp (Zstr form) reports equality\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (StrCmp(&hello, "Hello") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected StrCmp(==0) for equal Zstr\n");
        }
    // to SIZE_MAX.
    static bool test_index_of_whole_string(void) {
        WriteFmt("Testing StrIndexOf matches a key equal to the whole string\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (StrIndexOf(&s, "abc", 3) == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected index 0 for whole-string key\n");
        }
    // mutant rejects it outright.
    static bool test_starts_with_full_string(void) {
        WriteFmt("Testing StrStartsWith with a prefix equal to the whole string\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (StrStartsWith(&s, "Hello") == true);
        if (!result) {
            WriteFmt("    FAIL: Expected StrStartsWith true for full-string prefix\n");
        }
    // Asserting an exactly-negative result kills the mutant by value.
    static bool test_compare_min_picks_shorter(void) {
        WriteFmt("Testing str_compare uses the shorter length for the prefix (192:21)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (cmp == -1);
        if (!result) {
            WriteFmt("    FAIL: expected -1 (a is a strict prefix of b), got {}\n", cmp);
        }
    //   mutant : always false.
    static bool test_starts_with_true_on_match(void) {
        WriteFmt("Testing StrStartsWith returns true on a real prefix match (466:12)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (StrStartsWith(&s, &prefix) == true);
        if (!result) {
            WriteFmt("    FAIL: expected true for prefix 'Hello'\n");
        }
    //   mutant : equal lengths fail the `>` test -> false.
    static bool test_ends_with_full_length_suffix(void) {
        WriteFmt("Testing StrEndsWith matches a whole-string suffix (441:21)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (StrEndsWith(&s, "World") == true);
        if (!result) {
            WriteFmt("    FAIL: expected true for suffix equal to the whole string\n");
        }
    // NULL handle reach the inner replace path (Str.Mutants3).
    static bool test_replace_zstr_null_aborts(void) {
        WriteFmt("Testing str_replace_zstr NULL aborts\n");
        Str *null_str = NULL;
        StrReplace(null_str, "a", "b", 1);
    // corrupted s must abort before StrBegin(s) is read (Str.Mutants5).
    static bool test_str_find_str_corrupt_s_aborts(void) {
        WriteFmt("Testing StrFind validates s (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (Str.Mutants5).
    static bool test_str_find_str_corrupt_key_aborts(void) {
        WriteFmt("Testing StrFind validates key (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // corrupted s must abort before s->data/s->length are read (Str.Mutants5).
    static bool test_str_ends_with_str_corrupt_s_aborts(void) {
        WriteFmt("Testing StrEndsWith validates s (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // corrupted s must abort before StrBegin(s) is read (Str.Mutants5).
    static bool test_str_cmp_cstr_corrupt_s_aborts(void) {
        WriteFmt("Testing StrCmp(cstr) validates s (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // corrupted key must abort (s is valid) (Str.Mutants5).
    static bool test_str_index_of_str_corrupt_key_aborts(void) {
        WriteFmt("Testing StrIndexOf validates key (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NULL s must abort cleanly via validate_vec's NULL check (Str.Mutants5).
    static bool test_str_ends_with_zstr_null_aborts(void) {
        WriteFmt("Testing StrEndsWith(zstr) validates a NULL s (should abort)\n");
    
        (void)StrEndsWith((const Str *)NULL, "x"); // Zstr suffix -> str_ends_with_zstr
    // corrupted magic word must abort at the validation barrier (Str.Mutants6).
    static bool test_strip_str_corrupt_magic_aborts(void) {
        WriteFmt("Testing StrStrip aborts on corrupt magic\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // corrupt key magic must abort (Str.Mutants6).
    static bool test_contains_str_corrupt_key_magic_aborts(void) {
        WriteFmt("Testing StrContains aborts on corrupt key magic\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // a corrupt-magic Str must abort before its data is read (Str.Mutants6).
    static bool test_split_to_iters_corrupt_magic_aborts(void) {
        WriteFmt("Testing StrSplitToIters aborts on corrupt magic\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // than dereferencing a bogus header (Str.Mutants6).
    static bool test_str_hash_uninitialized_aborts(void) {
        WriteFmt("Testing str_hash aborts on uninitialized Str\n");
    
        Str bogus = {0};
    // a corrupt-magic Str must abort (Str.Mutants6).
    static bool test_cmp_zstr_ignore_case_corrupt_magic_aborts(void) {
        WriteFmt("Testing StrCmpIgnoreCase aborts on corrupt magic\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (Str.Mutants6).
    static bool test_starts_with_cstr_null_aborts(void) {
        WriteFmt("Testing StrStartsWith(Cstr) aborts on NULL Str\n");
    
        (void)StrStartsWith((Str *)NULL, "x", (size)1);
    // corrupted magic word must abort on that element (Str.Mutants6).
    static bool test_validate_strs_corrupt_element_aborts(void) {
        WriteFmt("Testing ValidateStrs aborts on corrupt element\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (Str.Mutants7).
    static bool test_split_validates(void) {
        WriteFmt("Testing StrSplit validates its Str (deadend)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (Str.Mutants7).
    static bool test_cmp_zstr_validates(void) {
        WriteFmt("Testing StrCmp (Zstr form) validates its Str (deadend)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // abort (Str.Mutants7).
    static bool test_index_of_validates(void) {
        WriteFmt("Testing StrIndexOf validates its Str (deadend)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // must abort (Str.Mutants7).
    static bool test_cmp_cstr_ignore_case_validates(void) {
        WriteFmt("Testing StrCmpIgnoreCase (Cstr form) validates its Str (deadend)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the validator's NULL check rather than dereferencing s->data (Str.Mutants7).
    static bool test_ends_with_cstr_validates(void) {
        WriteFmt("Testing StrEndsWith (Cstr form) validates its Str (deadend)\n");
    
        bool ends = StrEndsWith((const Str *)NULL, "x", 1);
    // (Str.Mutants8).
    static bool test_compare_validates_a(void) {
        WriteFmt("Testing str_compare validates its first operand (189:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `b`'s magic, keep `a` valid (Str.Mutants8).
    static bool test_compare_validates_b(void) {
        WriteFmt("Testing str_compare validates its second operand (190:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateStr(s). Corrupt `s`, keep `other` valid (Str.Mutants8).
    static bool test_cmp_ignore_case_validates_s(void) {
        WriteFmt("Testing str_cmp_str_ignore_case validates s (224:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ValidateStr(other). Corrupt `other`, keep `s` valid (Str.Mutants8).
    static bool test_cmp_ignore_case_validates_other(void) {
        WriteFmt("Testing str_cmp_str_ignore_case validates other (225:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Corrupt `s`, keep `prefix` valid (Str.Mutants8).
    static bool test_starts_with_validates_s(void) {
        WriteFmt("Testing str_starts_with_str validates s (465:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `s`, then search via the 3-arg StrFind form (-> str_find_cstr) (Str.Mutants8).
    static bool test_find_cstr_validates_s(void) {
        WriteFmt("Testing str_find_cstr validates s (240:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (Str.Mutants8).
    static bool test_replace_cstr_validates_s(void) {
        WriteFmt("Testing str_replace_cstr validates s (475:5)\n");
    
        // 6-arg form maps directly to str_replace_cstr(NULL, ...).
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Ops tests\n\n");
    
        // Array of test functions
    // Test StrTryReduceSpace function
    bool test_str_try_reduce_space(void) {
        WriteFmt("Testing StrTryReduceSpace\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrSwapCharAt function
    bool test_str_swap_char_at(void) {
        WriteFmt("Testing StrSwapCharAt\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrResize function
    bool test_str_resize(void) {
        WriteFmt("Testing StrResize\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrReserve function
    bool test_str_reserve(void) {
        WriteFmt("Testing StrReserve\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrClear function
    bool test_str_clear(void) {
        WriteFmt("Testing StrClear\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrReverse function
    bool test_str_reverse(void) {
        WriteFmt("Testing StrReverse\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Memory tests\n\n");
    
        // Array of test functions
    // Test StrInit function
    bool test_str_init(void) {
        WriteFmt("Testing StrInit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInitFromCstr function
    bool test_str_init_from_cstr(void) {
        WriteFmt("Testing StrInitFromCstr\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInitFromZstr function
    bool test_str_init_from_zstr(void) {
        WriteFmt("Testing StrInitFromZstr\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrZ alias
    bool test_str_z_alias(void) {
        WriteFmt("Testing StrZ\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInitFromStr function
    bool test_str_init_from_str(void) {
        WriteFmt("Testing StrInitFromStr\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrDup function (alias for StrInitFromStr)
    bool test_str_dup(void) {
        WriteFmt("Testing StrDup\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrAppendFmt function
    bool test_str_WriteFmt(void) {
        WriteFmt("Testing StrAppendFmt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInitStack macro
    bool test_str_init_stack(void) {
        WriteFmt("Testing StrInitStack\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInitCopy function
    bool test_str_init_copy(void) {
        WriteFmt("Testing StrInitCopy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test that Str clones inherit the source allocator pointer
    bool test_str_clone_inherits_allocator_config(void) {
        WriteFmt("Testing Str clone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrDeinit function
    bool test_str_deinit(void) {
        WriteFmt("Testing StrDeinit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // under the mutant (Str.Mutants7).
    static bool test_deinit_frees_buffer(void) {
        WriteFmt("Testing StrDeinit releases the backing allocation\n");
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
        bool result = (DebugAllocatorLiveCount(&dbg) == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected 0 live allocations after StrDeinit\n");
        }
    // Corrupt `src`, keep `dst` an unrelated valid handle (Str.Mutants8).
    static bool test_init_copy_validates_src(void) {
        WriteFmt("Testing str_init_copy validates src (135:5)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Init tests\n\n");
    
        // Array of test functions
    // Test StrInsertR function
    bool test_str_insert_char_at(void) {
        WriteFmt("Testing StrInsertR\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInsertMany 4-arg (Cstr) form
    bool test_str_insert_cstr(void) {
        WriteFmt("Testing StrInsertMany (Cstr form)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInsertMany 3-arg Zstr form
    bool test_str_insert_zstr(void) {
        WriteFmt("Testing StrInsertMany (Zstr form)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInsertMany function
    bool test_str_push_cstr(void) {
        WriteFmt("Testing StrInsertMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrInsertMany function
    bool test_str_push_zstr(void) {
        WriteFmt("Testing StrInsertMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushBackMany function
    bool test_str_push_back_cstr(void) {
        WriteFmt("Testing StrPushBackMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushBackMany function
    bool test_str_push_back_zstr(void) {
        WriteFmt("Testing StrPushBackMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushFrontMany function
    bool test_str_push_front_cstr(void) {
        WriteFmt("Testing StrPushFrontMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushFrontMany function
    bool test_str_push_front_zstr(void) {
        WriteFmt("Testing StrPushFrontMany\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushBack function
    bool test_str_push_back(void) {
        WriteFmt("Testing StrPushBack\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPushFront function
    bool test_str_push_front(void) {
        WriteFmt("Testing StrPushFront\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrMergeL function
    bool test_str_merge_l(void) {
        WriteFmt("Testing StrMergeL\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrMergeR function
    bool test_str_merge_r(void) {
        WriteFmt("Testing StrMergeR\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrMerge function (unsuffixed = L-form per convention; src zeroed).
    bool test_str_merge(void) {
        WriteFmt("Testing StrMerge\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // StrAppendf formatter.
    bool test_str_write_fmt_append(void) {
        WriteFmt("Testing StrAppendFmt append\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Insert tests\n\n");
    
        // Array of test functions
    // Test Str type definition
    bool test_str_type(void) {
        WriteFmt("Testing Str type definition\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test Strs type definition
    bool test_strs_type(void) {
        WriteFmt("Testing Strs type definition\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateStr macro
    bool test_validate_str(void) {
        WriteFmt("Testing ValidateStr macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateStrs macro
    bool test_validate_strs(void) {
        WriteFmt("Testing ValidateStrs macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Deadend test: Test ValidateStr with invalid string (should crash/abort)
    bool test_validate_invalid_str(void) {
        WriteFmt("Testing ValidateStr with invalid string (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Deadend test: Test ValidateStrs with invalid Strs (should crash/abort)
    bool test_validate_invalid_strs(void) {
        WriteFmt("Testing ValidateStrs with invalid Strs (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Type tests\n\n");
    
        // Array of normal test functions
    // Test StrPopBack function
    bool test_str_pop_back(void) {
        WriteFmt("Testing StrPopBack\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrPopFront function
    bool test_str_pop_front(void) {
        WriteFmt("Testing StrPopFront\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrRemove function
    bool test_str_remove(void) {
        WriteFmt("Testing StrRemove\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrRemoveRange function
    bool test_str_remove_range(void) {
        WriteFmt("Testing StrRemoveRange\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrDeleteLastChar function
    bool test_str_delete_last_char(void) {
        WriteFmt("Testing StrDeleteLastChar\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrDelete function
    bool test_str_delete(void) {
        WriteFmt("Testing StrDelete\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrDeleteRange function
    bool test_str_delete_range(void) {
        WriteFmt("Testing StrDeleteRange\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Remove tests\n\n");
    
        // Array of test functions
    // Test StrFromU64 function
    bool test_str_from_u64(void) {
        WriteFmt("Testing StrFromU64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ZstrCompare(StrBegin(&s), "12345") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '12345', got '{}'\n", s);
        }
        result = result && (ZstrCompare(StrBegin(&s), "0xabcd") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0xabcd', got '{}'\n", s);
        }
        result = result && (ZstrCompare(StrBegin(&s), "0xABCD") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0xABCD', got '{}'\n", s);
        }
        result = result && (ZstrCompare(StrBegin(&s), "0b101010") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0b101010', got '{}'\n", s);
        }
        result = result && (ZstrCompare(StrBegin(&s), "0o52") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0o52', got '{}'\n", s);
        }
        result = result && (ZstrCompare(StrBegin(&s), "0") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0', got '{}'\n", s);
        }
    // Test StrFromI64 function
    bool test_str_from_i64(void) {
        WriteFmt("Testing StrFromI64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ZstrCompare(StrBegin(&s), "12345") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '12345', got '{}'\n", StrBegin(&s));
        }
        result = result && (ZstrCompare(StrBegin(&s), "-12345") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '-12345', got '{}'\n", StrBegin(&s));
        }
        result = result && (ZstrCompareN(StrBegin(&s), "0x", 2) == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected hex prefix '0x', got '{}'\n", StrBegin(&s));
        }
        result = result && (ZstrCompare(StrBegin(&s), "0") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0', got '{}'\n", StrBegin(&s));
        }
        result = result && (ZstrCompare(StrBegin(&s), "0b101010") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '0b101010', got '{}'\n", StrBegin(&s));
        }
    // Test StrFromF64 function
    bool test_str_from_f64(void) {
        WriteFmt("Testing StrFromF64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ZstrCompare(StrBegin(&s), "123.00") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '123.00', got '{}'\n", StrBegin(&s));
        }
        result = result && (ZstrCompare(StrBegin(&s), "123.456") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '123.456', got '{}'\n", StrBegin(&s));
        }
    // Test StrToU64 function
    bool test_str_to_u64(void) {
        WriteFmt("Testing StrToU64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrToI64 function
    bool test_str_to_i64(void) {
        WriteFmt("Testing StrToI64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrToF64 function
    bool test_str_to_f64(void) {
        WriteFmt("Testing StrToF64\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Round-trip conversion tests
    bool test_str_round_trip_conversions(void) {
        WriteFmt("Testing Str round-trip conversions\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Edge case conversion tests
    bool test_str_edge_case_conversions(void) {
        WriteFmt("Testing Str edge case conversions\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Precision limits testing
    bool test_str_precision_limits(void) {
        WriteFmt("Testing Str precision limits\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Large-scale conversion tests
    bool test_str_all_base_support(void) {
        WriteFmt("Testing Str all bases 2-36 support\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_str_large_scale_conversions(void) {
        WriteFmt("Testing Str large-scale conversions\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Deadend tests for NULL pointer handling
    bool test_str_conversion_null_failures(void) {
        WriteFmt("Testing Str conversion NULL pointer handling\n");
    
        // Test NULL string pointer - should abort
    
    bool test_str_conversion_bounds_failures(void) {
        WriteFmt("Testing Str conversion bounds failures\n");
    
        // Test StrFromI64 with NULL pointer - should abort
    
    bool test_str_conversion_invalid_input_failures(void) {
        WriteFmt("Testing Str conversion invalid input failures\n");
    
        // Test StrFromF64 with NULL pointer - should abort
    // (5 < 99). Real code rejects base 99; the mutant parses "5" as 5.
    static bool test_str_to_u64_invalid_base_rejected(void) {
        WriteFmt("Testing StrToU64 rejects an out-of-range base\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // parse of "ff" must succeed with value 255.
    static bool test_str_to_u64_valid_base_sixteen_accepted(void) {
        WriteFmt("Testing StrToU64 accepts explicit base 16\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // digit and is rejected. Real code parses 42.
    static bool test_str_to_u64_leading_space_skipped(void) {
        WriteFmt("Testing StrToU64 skips leading whitespace\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // falls into the empty-string path. Real code parses 42.
    static bool test_str_to_u64_leading_space_advance(void) {
        WriteFmt("Testing StrToU64 advances over leading whitespace\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // decimal 5. Mutant skips "0","5", finds no digits, returns false.
    static bool test_str_to_u64_zero_five_is_decimal(void) {
        WriteFmt("Testing StrToU64 parses 05 as decimal\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // digits and must be rejected. Mutant returns true with value 0.
    static bool test_str_to_u64_prefix_only_rejected(void) {
        WriteFmt("Testing StrToU64 rejects bare 0x prefix\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // slip through. UINT64_MAX+1 == "18446744073709551616" must be rejected.
    static bool test_str_to_u64_overflow_rejected(void) {
        WriteFmt("Testing StrToU64 rejects u64 overflow\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // must parse to 42. Mutant returns false.
    static bool test_str_to_u64_have_digits_set(void) {
        WriteFmt("Testing StrToU64 marks digits consumed\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // wrongly reports extra characters for "42 ". Real code parses 42.
    static bool test_str_to_u64_trailing_space_skipped_strict(void) {
        WriteFmt("Testing StrToU64 skips trailing whitespace in strict mode\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // strict mode wrongly rejects "42  ". Real code parses 42.
    static bool test_str_to_u64_trailing_space_advance_strict(void) {
        WriteFmt("Testing StrToU64 advances over trailing whitespace in strict mode\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // trailing junk. "42x" in strict mode must be rejected. Mutant returns true.
    static bool test_str_to_u64_strict_rejects_trailing_junk(void) {
        WriteFmt("Testing StrToU64 strict mode rejects trailing junk\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // including a clean "42". Real code parses 42.
    static bool test_str_to_u64_strict_accepts_clean(void) {
        WriteFmt("Testing StrToU64 strict mode accepts a clean number\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant the barrier is gone and the corruption is not caught at entry.
    static bool test_str_to_u64_validate_barrier(void) {
        WriteFmt("Testing StrToU64 validate barrier aborts on corrupt Str\n");
    
        Str            bad    = {0}; // zeroed magic: ValidateStr must LOG_FATAL
    // 4-byte "nan\0" instead of the 3-byte "nan".
    static bool test_nan_length_and_bytes(void) {
        WriteFmt("Testing StrFromF64 NaN emits exactly 3 bytes\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (StrLen(&s) == 3) && (ZstrCompare(StrBegin(&s), "nan") == 0);
        if (!result)
            WriteFmt("    FAIL: expected len 3 \"nan\", got len {} \"{}\"\n", StrLen(&s), StrBegin(&s));
    
        StrDeinit(&s);
    // pushes it, giving 4-byte "inf\0" instead of 3-byte "inf".
    static bool test_inf_length_and_bytes(void) {
        WriteFmt("Testing StrFromF64 inf emits exactly 3 bytes\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (StrLen(&s) == 3) && (ZstrCompare(StrBegin(&s), "inf") == 0);
        if (!result)
            WriteFmt("    FAIL: expected len 3 \"inf\", got len {} \"{}\"\n", StrLen(&s), StrBegin(&s));
    
        StrDeinit(&s);
    // fixed notation ("0.000100") to scientific ("1.000000e-04").
    static bool test_small_threshold_stays_fixed(void) {
        WriteFmt("Testing StrFromF64 0.0001 stays fixed notation\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "0.000100") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"0.000100\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // of scientific ("1.00e+07").
    static bool test_large_threshold_uses_sci(void) {
        WriteFmt("Testing StrFromF64 1e7 uses scientific notation\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "1.00e+07") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"1.00e+07\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // zero-iteration fraction loop, giving "5.e+00" instead of "5e+00".
    static bool test_sci_precision_zero_no_dot(void) {
        WriteFmt("Testing StrFromF64 scientific precision 0 omits dot\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "5e+00") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"5e+00\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // the else branch: emits '-' and "00", giving "5.00e-00" instead of "5.00e+00".
    static bool test_sci_zero_exponent_sign(void) {
        WriteFmt("Testing StrFromF64 zero exponent prints +00\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "5.00e+00") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"5.00e+00\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // must return the destination handle, not NULL.
    static bool test_sci_exponent_success_returns_handle(void) {
        WriteFmt("Testing StrFromF64 scientific success returns handle\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (r == &s) && (ZstrCompare(StrBegin(&s), "1.23e+02") == 0);
        if (!result)
            WriteFmt("    FAIL: expected handle + \"1.23e+02\", got null={} \"{}\"\n", (r == NULL), StrBegin(&s));
    
        StrDeinit(&s);
    // successful call must return the destination handle.
    static bool test_fixed_integer_success_returns_handle(void) {
        WriteFmt("Testing StrFromF64 fixed success returns handle\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (r == &s) && (ZstrCompare(StrBegin(&s), "123.00") == 0);
        if (!result)
            WriteFmt("    FAIL: expected handle + \"123.00\", got null={} \"{}\"\n", (r == NULL), StrBegin(&s));
    
        StrDeinit(&s);
    // zero-iteration fraction loop, giving "123." instead of "123".
    static bool test_fixed_precision_zero_no_dot(void) {
        WriteFmt("Testing StrFromF64 fixed precision 0 omits dot\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "123") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"123\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // the fractional digits become garbage instead of "456".
    static bool test_fixed_fraction_scale_seed(void) {
        WriteFmt("Testing StrFromF64 fixed fraction scale seed\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "123.456") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"123.456\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // raw value and emits "0.123".
    static bool test_fixed_round_half_up(void) {
        WriteFmt("Testing StrFromF64 fixed half-up rounding\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        Str              s     = StrInit(&alloc);
        bool result = (ZstrCompare(StrBegin(&s), "0.124") == 0);
        if (!result)
            WriteFmt("    FAIL: expected \"0.124\", got \"{}\"\n", StrBegin(&s));
    
        StrDeinit(&s);
    // past the fail-fast barrier. Deadend: a NULL str must abort.
    static bool test_from_f64_null_aborts(void) {
        WriteFmt("Testing StrFromF64 NULL aborts\n");
        StrFloatFormat config = {.precision = 2, .force_sci = false, .uppercase = false};
        StrFromF64(NULL, 1.0, &config);
    
    static bool test_from_f64_null_aborts_high_precision(void) {
        WriteFmt("Testing StrFromF64 NULL aborts before the precision guard\n");
        StrFloatFormat config = {.precision = 18, .force_sci = false, .uppercase = false};
        StrFromF64(NULL, 1.0, &config);
    // missed. "  -5" must still parse to -5.
    static bool test_str_to_i64_leading_space_negative(void) {
        WriteFmt("Testing StrToI64 strips leading spaces before negative sign\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // must still parse to 5.
    static bool test_str_to_i64_leading_space_positive(void) {
        WriteFmt("Testing StrToI64 advances past leading spaces\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the '-' branch, so a negative input is stored positive. "-5" must be -5.
    static bool test_str_to_i64_negative_sign(void) {
        WriteFmt("Testing StrToI64 honors the negative sign\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // wrapping pos and building a garbage substring view. "+5" must parse to 5.
    static bool test_str_to_i64_plus_sign(void) {
        WriteFmt("Testing StrToI64 skips a leading plus sign\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the mutant the abort kills the process and this normal test never returns.
    static bool test_str_to_i64_long_zero_view(void) {
        WriteFmt("Testing StrToI64 sets the borrowed view capacity to its length\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // INT64_MIN ("-9223372036854775808") must still parse.
    static bool test_str_to_i64_int64_min(void) {
        WriteFmt("Testing StrToI64 accepts INT64_MIN\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // "2" in base 2 maps '2' -> digit 2 which must be rejected (parse fails).
    static bool test_char_to_digit_base_boundary(void) {
        WriteFmt("Testing char_to_digit rejects a digit equal to the base\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // StrToI64. A corrupted Str (length > capacity, dirty magic) must abort.
    static bool test_str_to_i64_corrupt_str_aborts(void) {
        WriteFmt("Testing StrToI64 validates its Str argument (should abort)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // be the full magnitude.
    static bool test_from_i64_int64_min_exact_digits(void) {
        WriteFmt("Testing StrFromI64(INT64_MIN) exact digits\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // truncates to "2.2".
    static bool test_round_f64_guard_first_term(void) {
        WriteFmt("Testing StrFromF64 rounds 2.25@p1 to 2.3 (round_f64 guard, first term)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ZstrCompare(StrBegin(&s), "2.3") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '2.3', got '{}'\n", StrBegin(&s));
        }
    // is skipped and 2.25@p1 prints "2.2" instead of "2.3".
    static bool test_round_f64_guard_second_term(void) {
        WriteFmt("Testing StrFromF64 rounds 2.25@p1 to 2.3 (round_f64 guard, second term)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ZstrCompare(StrBegin(&s), "2.3") == 0);
        if (!result) {
            WriteFmt("    FAIL: Expected '2.3', got '{}'\n", StrBegin(&s));
        }
    //   mutant : runs the digit loop (value % 37) and returns &s (non-NULL).
    static bool test_from_u64_rejects_invalid_base(void) {
        WriteFmt("Testing StrFromU64 rejects an invalid base with NULL (564:10)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ret == NULL);
        if (!result) {
            WriteFmt("    FAIL: expected NULL return for base 37, got non-NULL\n");
        }
    // is what kills the mutant.
    static bool test_from_u64_success_returns_str(void) {
        WriteFmt("Testing StrFromU64 returns the Str pointer on success (595:14)\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        bool result = (ret == &s) && (ZstrCompare(StrBegin(&s), "12345") == 0);
        if (!result) {
            WriteFmt("    FAIL: expected &s and '12345', got ret={} '{}'\n", (ret != NULL), s);
        }
    //   mutant : `ok` becomes true -> returns &s (non-NULL).
    static bool test_from_u64_oom_returns_null(void) {
        WriteFmt("Testing StrFromU64 returns NULL when a digit push fails (609:24)\n");
    
        // Buffer large enough for the bitmap word + one 8-byte slot, but the slot
        bool result = (ret == NULL);
        if (!result) {
            WriteFmt("    FAIL: expected NULL on allocation failure, got non-NULL\n");
        }
    //   mutant : `ok` becomes truthy -> falls through -> returns &s (non-NULL).
    static bool test_from_f64_int_oom_returns_null(void) {
        WriteFmt("Testing StrFromF64 returns NULL when an integer-digit push fails (817:28)\n");
    
        u8              buf[64] = {0};
        bool result = (ret == NULL);
        if (!result) {
            WriteFmt("    FAIL: expected NULL on integer-digit allocation failure, got non-NULL\n");
        }
    //   mutant : `ok` becomes truthy -> falls through -> returns &s (non-NULL).
    static bool test_from_f64_exp_oom_returns_null(void) {
        WriteFmt("Testing StrFromF64 returns NULL when an exponent-digit push fails (790:28)\n");
    
        u8              buf[512] = {0};
        bool result = (ret == NULL);
        if (!result) {
            WriteFmt("    FAIL: expected NULL on exponent-digit allocation failure, got non-NULL\n");
        }
    // and fails.
    static bool test_to_u64_base2_uppercase_prefix_skipped(void) {
        WriteFmt("Testing StrToU64 skips 0B prefix on explicit base 2 (533:51)\n");
    
        DefaultAllocator alloc  = DefaultAllocatorInit();
    // success with value 1.0.
    static bool test_to_f64_missing_exponent_digits_fails(void) {
        WriteFmt("Testing StrToF64 rejects missing exponent digits (1108:14)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Convert tests\n\n");
    
        // Array of normal test functions
    // Test StrForeachIdx macro
    bool test_str_foreach_idx(void) {
        WriteFmt("Testing StrForeachIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachReverseIdx macro
    bool test_str_foreach_reverse_idx(void) {
        WriteFmt("Testing StrForeachReverseIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        bool success = (ZstrCompare(StrBegin(&result), "o4l3l2e1H0") == 0);
        WriteFmt("  (Index 0 was processed)\n");
    
        StrDeinit(&s);
    // Test StrForeachPtrIdx macro
    bool test_str_foreach_ptr_idx(void) {
        WriteFmt("Testing StrForeachPtrIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachReversePtrIdx macro
    bool test_str_foreach_reverse_ptr_idx(void) {
        WriteFmt("Testing StrForeachReversePtrIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        success      = (ZstrCompare(StrBegin(&result), "o4l3l2e1H0") == 0);
        success      = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
        WriteFmt("  (Index 0 was processed)\n");
    
        StrDeinit(&s);
    // Test StrForeach macro
    bool test_str_foreach(void) {
        WriteFmt("Testing StrForeach\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachReverse macro
    bool test_str_foreach_reverse(void) {
        WriteFmt("Testing StrForeachReverse\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        if (char_count == StrLen(&s)) {
            success = (ZstrCompare(StrBegin(&result), "olleH") == 0);
            WriteFmt("  (All characters were processed)\n");
        } else {
            success = (ZstrCompare(StrBegin(&result), "olle") == 0);
        } else {
            success = (ZstrCompare(StrBegin(&result), "olle") == 0);
            WriteFmt("  (First character was NOT processed - bug in macro)\n");
        }
    // Test StrForeachPtr macro
    bool test_str_foreach_ptr(void) {
        WriteFmt("Testing StrForeachPtr\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachPtrReverse macro
    bool test_str_foreach_ptr_reverse(void) {
        WriteFmt("Testing StrForeachPtrReverse\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
            success = (ZstrCompare(StrBegin(&result), "olleH") == 0);
            success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
            WriteFmt("  (All characters were processed)\n");
        } else {
            success = (ZstrCompare(StrBegin(&result), "olle") == 0);
            success = (ZstrCompare(StrBegin(&result), "olle") == 0);
            success = success && (ZstrCompare(StrBegin(&s), "HELLo") == 0); // All uppercase except first char
            WriteFmt("  (First character was NOT processed - bug in macro)\n");
        }
    // Test StrForeachInRangeIdx macro
    bool test_str_foreach_in_range_idx(void) {
        WriteFmt("Testing StrForeachInRangeIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachInRange macro
    bool test_str_foreach_in_range(void) {
        WriteFmt("Testing StrForeachInRange\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachPtrInRangeIdx macro
    bool test_str_foreach_ptr_in_range_idx(void) {
        WriteFmt("Testing StrForeachPtrInRangeIdx\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrForeachPtrInRange macro
    bool test_str_foreach_ptr_in_range(void) {
        WriteFmt("Testing StrForeachPtrInRange\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Make idx go out of bounds in StrForeachInRangeIdx by shrinking string during iteration
    bool test_str_foreach_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachInRangeIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        size original_length = StrLen(&s); // Capture this as 12
        StrForeachInRangeIdx(&s, chr, idx, 0, original_length) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), chr);
    
            // When we reach idx=4, drastically shrink the string to length 3
            if (idx == 4) {
                StrResize(&s, 3); // Shrink to only 3 characters
                WriteFmt("String resized to length {}, idx={}...\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in StrForeachInRangeIdx by deleting characters
    bool test_str_foreach_idx_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachInRangeIdx with character deletion where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        size original_length = StrLen(&s); // Capture this as 11
        StrForeachInRangeIdx(&s, chr, idx, 0, original_length) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), chr);
    
            // When we reach idx=3, delete several characters from the beginning
            if (idx == 3) {
                StrDeleteRange(&s, 0, 6); // Remove first 6 characters
                WriteFmt("Deleted first 6 characters, new length={}, idx={}...\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in StrForeachReverseIdx by modifying string during iteration
    bool test_str_foreach_reverse_idx_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachReverseIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        // StrForeachReverseIdx (VecForeachReverseIdx) has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        StrForeachReverseIdx(&s, chr, idx) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), chr);
    
            // When we reach idx=10, drastically shrink the string
            if (idx == 10) {
                StrResize(&s, 4); // Shrink to only 4 characters
                WriteFmt("String resized to length {} during reverse iteration... idx = {}\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in StrForeachPtrIdx by modifying string during iteration
    bool test_str_foreach_ptr_idx_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachPtrIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        // StrForeachPtrIdx (VecForeachPtrIdx) has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        StrForeachPtrIdx(&s, chr_ptr, idx) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), *chr_ptr);
    
            // When we reach idx=4, delete most characters from the string
            if (idx == 4) {
                StrResize(&s, 4); // Shrink to only 4 characters (valid indices: 0,1,2,3)
                WriteFmt("String resized to length {}, current idx={} is now out of bounds...\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in StrForeachReversePtrIdx by modifying string during iteration
    bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachReversePtrIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        // StrForeachReversePtrIdx (VecForeachPtrReverseIdx) has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        StrForeachReversePtrIdx(&s, chr_ptr, idx) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), *chr_ptr);
    
            // When we reach idx=12, shrink the string significantly
            if (idx == 12) {
                StrResize(&s, 5); // Shrink to only 5 characters
                WriteFmt("String resized to length {} during reverse ptr iteration... idx = {}\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in StrForeachPtrInRangeIdx by modifying string during iteration
    bool test_str_foreach_ptr_in_range_idx_out_of_bounds_access(void) {
        WriteFmt("Testing StrForeachPtrInRangeIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        size original_length = StrLen(&s); // Capture this as 32
        StrForeachPtrInRangeIdx(&s, chr_ptr, idx, 0, original_length) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), *chr_ptr);
    
            // When we reach idx=8, delete several characters
            if (idx == 8) {
                StrDeleteRange(&s, 0, 20); // Remove first 20 characters
                WriteFmt("Deleted first 20 characters, new length={}, idx = {}...\n", StrLen(&s), idx);
            }
    // Make idx go out of bounds in basic StrForeachIdx by modifying string during iteration
    bool test_str_foreach_idx_basic_out_of_bounds_access(void) {
        WriteFmt("Testing basic StrForeachIdx where idx goes out of bounds\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
        // Basic StrForeachIdx (VecForeachIdx) now has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        StrForeachIdx(&s, chr, idx) {
            WriteFmt("Accessing idx {} (s.length={}): '{c}'\n", idx, StrLen(&s), chr);
    
            // When we reach idx=3, drastically shrink the string
            if (idx == 3) {
                StrResize(&s, 2); // Shrink to only 2 characters
                WriteFmt(
                    "String resized to length {}, but basic foreach iteration continues... idx = {}\n",
                    StrLen(&s),
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Foreach.Simple tests\n\n");
    
        // Array of normal test functions
    // Test StrLen and StrEmpty functions
    bool test_str_len_empty(void) {
        WriteFmt("Testing StrLen and StrEmpty\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrFirst function
    bool test_str_first(void) {
        WriteFmt("Testing StrFirst\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrLast function
    bool test_str_last(void) {
        WriteFmt("Testing StrLast\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrBegin function
    bool test_str_begin(void) {
        WriteFmt("Testing StrBegin\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrEnd function
    bool test_str_end(void) {
        WriteFmt("Testing StrEnd\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrCharAt function
    bool test_str_char_at(void) {
        WriteFmt("Testing StrCharAt\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test StrCharPtrAt function
    bool test_str_char_ptr_at(void) {
        WriteFmt("Testing StrCharPtrAt\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Str.Access tests\n\n");
    
        // Array of test functions
    
    static bool test_list_clear_and_reuse(void) {
        WriteFmt("Testing ListClear and reuse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_sort_and_reverse(void) {
        WriteFmt("Testing ListSort and ListReverse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_sort_and_reverse_edge_cases(void) {
        WriteFmt("Testing ListSort and ListReverse edge cases\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_clear_with_deep_copy(void) {
        WriteFmt("Testing ListClear with deep copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // actually ascending afterward.
    static bool test_sort_two_element_list(void) {
        WriteFmt("Testing ListSort orders a two-element list\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //                            bounds -> LOG_FATAL aborts the run.
    static bool test_merge_failed_rolls_back(void) {
        WriteFmt("Testing merge rollback restores pre-merge length\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Ops tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Ops");
    }
    
    static bool test_list_init_variants(void) {
        WriteFmt("Testing List init variants\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_init_optional_allocator(void) {
        WriteFmt("Testing List init optional allocator\n");
    
        typedef List(int) IntList;
    
    static bool test_list_deinit_with_deep_copy(void) {
        WriteFmt("Testing ListDeinit with deep copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Init tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Init");
    }
    
    static bool test_list_insert_and_push_aliases(void) {
        WriteFmt("Testing List insert and push aliases\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_push_arr_l_zeroes_all_items(void) {
        WriteFmt("Testing ListPushArrL zeroes all transferred items\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_push_arr_zero_count_is_noop(void) {
        WriteFmt("Testing ListPushArrL zero-count contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_insert_with_deep_copy(void) {
        WriteFmt("Testing List insert with deep copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_merge_l_preserves_source_hooks_for_reuse(void) {
        WriteFmt("Testing ListMergeL preserves source hooks for reuse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_merge_variants(void) {
        WriteFmt("Testing List merge variants\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_merge_edge_cases(void) {
        WriteFmt("Testing List merge edge cases\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // and the values landed.
    static bool test_push_arr_r_actually_inserts(void) {
        WriteFmt("Testing ListPushArrR actually appends the source range\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //                            start+count>length -> LOG_FATAL aborts the run.
    static bool test_push_arr_failed_rolls_back(void) {
        WriteFmt("Testing push_arr rollback restores pre-call length\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Insert tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Insert");
    }
    
    static bool test_list_type_defaults(void) {
        WriteFmt("Testing List type defaults\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_node_type_layout(void) {
        WriteFmt("Testing ListNode type layout\n");
    
        int value          = 42;
    // ---------------------------------------------------------------------------
    static bool test_validate_memoization_skips_structural(void) {
        WriteFmt("Testing validate_list memoization gate (and-to-or)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Type tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Type");
    }
    
    static bool test_validate_corrupt_empty_list_fails(void) {
        WriteFmt("Testing ValidateList on corrupt empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_validate_null_list_fails(void) {
        WriteFmt("Testing ValidateList on NULL list\n");
    
        ValidateList(NULL);
    
    static bool test_validate_invalid_magic_fails(void) {
        WriteFmt("Testing ValidateList on invalid magic\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_validate_corrupt_nonempty_list_fails(void) {
        WriteFmt("Testing ValidateList on corrupt non-empty list\n");
    
        GenericListNode node = {0};
    
    static bool test_validate_nonempty_head_null_fails(void) {
        WriteFmt("Testing ValidateList on non-empty NULL head\n");
    
        int             value = 1;
    
    static bool test_validate_head_prev_fails(void) {
        WriteFmt("Testing ValidateList on head prev corruption\n");
    
        int             value = 1;
    
    static bool test_validate_tail_next_fails(void) {
        WriteFmt("Testing ValidateList on tail next corruption\n");
    
        int             value = 1;
    
    static bool test_list_ptr_at_empty_fails(void) {
        WriteFmt("Testing ListPtrAt on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_ptr_at_out_of_bounds_fails(void) {
        WriteFmt("Testing ListPtrAt out of bounds\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_at_out_of_bounds_fails(void) {
        WriteFmt("Testing ListAt out of bounds\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_node_ptr_at_empty_fails(void) {
        WriteFmt("Testing ListNodePtrAt on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_node_ptr_at_out_of_bounds_fails(void) {
        WriteFmt("Testing ListNodePtrAt out of bounds\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_node_at_out_of_bounds_fails(void) {
        WriteFmt("Testing ListNodeAt out of bounds\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_first_on_empty_fails(void) {
        WriteFmt("Testing ListFirst on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_last_on_empty_fails(void) {
        WriteFmt("Testing ListLast on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_node_at_empty_fails(void) {
        WriteFmt("Testing ListNodeAt on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_insert_out_of_range_fails(void) {
        WriteFmt("Testing ListInsertR out of range\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_remove_out_of_range_fails(void) {
        WriteFmt("Testing ListRemove out of range\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_pop_front_empty_fails(void) {
        WriteFmt("Testing ListPopFront on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_pop_back_empty_fails(void) {
        WriteFmt("Testing ListPopBack on empty list\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_remove_range_out_of_range_fails(void) {
        WriteFmt("Testing ListRemoveRange out of range\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_swap_items_out_of_range_fails(void) {
        WriteFmt("Testing ListSwapItems out of range\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_find_without_compare_fails(void) {
        WriteFmt("Testing ListFind without compare function\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_find_without_key_fails(void) {
        WriteFmt("Testing ListFind without key pointer\n");
    
        List(int) list = ListInit(get_test_alloc());
    
    static bool test_list_node_relative_null_fails(void) {
        WriteFmt("Testing ListNodeRelative with NULL node\n");
    
        ListNodeRelative(NULL, 1);
    
    static bool test_list_sort_without_compare_fails(void) {
        WriteFmt("Testing ListSort without compare function\n");
    
        List(int) list = ListInit(get_test_alloc());
    // would let the out-of-bounds index through.
    static bool test_iteration_target_at_length_fails(void) {
        WriteFmt("Testing get_node_for_list_iteration target == length\n");
    
        List(int) list = ListInit(get_test_alloc());
    // instead of aborting. We assert the call aborts.
    static bool test_random_access_relative_target_at_length_fails(void) {
        WriteFmt("Testing get_node_random_access relative target == length aborts\n");
    
        List(int) list = ListInit(get_test_alloc());
    // ---------------------------------------------------------------------------
    static bool deadend_random_access_nidx_equals_length(void) {
        WriteFmt("Testing get_node_random_access nidx==length is rejected\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Deadend tests\n\n");
        return run_test_suite(
            NULL,
    
    static bool test_list_remove_and_pop(void) {
        WriteFmt("Testing ListRemove and pop helpers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_remove_range_and_delete_aliases(void) {
        WriteFmt("Testing ListRemoveRange and delete aliases\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_remove_range_prefix_suffix_edges(void) {
        WriteFmt("Testing ListRemoveRange prefix/suffix edges\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_remove_range_whole_list_to_buffer(void) {
        WriteFmt("Testing ListRemoveRange whole-list buffered removal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_remove_zero_count_and_deep_copy_delete(void) {
        WriteFmt("Testing ListRemoveRange zero-count and deep-copy delete\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_remove_range_with_deep_copy_buffer(void) {
        WriteFmt("Testing ListRemoveRange buffer semantics with deep copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Remove tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Remove");
    }
    
    static bool test_list_foreach_basic(void) {
        WriteFmt("Testing basic List foreach macros\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_foreach_ranges(void) {
        WriteFmt("Testing ranged List foreach macros\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_foreach_range_edge_cases(void) {
        WriteFmt("Testing List ranged foreach edge cases\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_foreach_index_variants(void) {
        WriteFmt("Testing indexed List foreach macros\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_foreach_index_jump_contract(void) {
        WriteFmt("Testing indexed List foreach jump contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_foreach_empty_lists(void) {
        WriteFmt("Testing List foreach macros on empty list\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Foreach tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Foreach");
    }
    
    static bool test_list_len_empty(void) {
        WriteFmt("Testing ListLen and ListEmpty\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_value_access_and_swap(void) {
        WriteFmt("Testing List accessors and swap\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_node_access_and_navigation(void) {
        WriteFmt("Testing List node access and navigation\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_list_find_contains(void) {
        WriteFmt("Testing ListFind and ListContains\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // at the requested index.
    static bool test_random_access_head_origin_value(void) {
        WriteFmt("Testing random-access foreach head-origin target value contract\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   495 dec_to_inc (steps never reaches 0 -> walks off end -> NULL)
    static bool test_random_access_node_origin_forward(void) {
        WriteFmt("Testing get_node_random_access node-origin forward step\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   492 init_const (steps=42 -> enters forward loop -> walks off end -> NULL)
    static bool test_random_access_node_origin_backward(void) {
        WriteFmt("Testing get_node_random_access node-origin backward step\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // dist_from_node=2, dist_from_head=5, dist_from_tail=3 -> node-origin branch.
    static bool test_random_access_node_origin_forward_multistep(void) {
        WriteFmt("Testing get_node_random_access node-origin multi-step forward\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // decrementing step makes it stop at the wrong node or run off to NULL.
    static bool test_random_access_head_walk_returns_target(void) {
        WriteFmt("Testing get_node_random_access head-walk origin\n");
    
        List(int) list = ListInit(get_test_alloc());
    // wrong node or run off to NULL.
    static bool test_random_access_tail_walk_returns_target(void) {
        WriteFmt("Testing get_node_random_access tail-walk origin\n");
    
        List(int) list = ListInit(get_test_alloc());
    // neighbouring node.
    static bool test_iteration_no_cursor_resolves_every_index(void) {
        WriteFmt("Testing get_node_for_list_iteration no-cursor resolution\n");
    
        List(int) list = ListInit(get_test_alloc());
    // Both yield a wrong node; we assert the resolved node carries index-2's data.
    static bool test_iteration_head_walk_lands_on_target(void) {
        WriteFmt("Testing iteration head-walk resolves exact target index\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // We assert the resolved node is non-NULL and carries index-3's data.
    static bool test_iteration_tail_walk_lands_on_target(void) {
        WriteFmt("Testing iteration tail-walk resolves exact target index\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // head; assert we get a real node carrying the head's value.
    static bool test_relative_back_to_head_returns_head(void) {
        WriteFmt("Testing ListNodeRelative back-walk landing on head\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    static bool test_node_origin_tail_zero_step(void) {
        WriteFmt("Testing get_node_random_access node-origin tail zero-step\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting List.Access tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "List.Access");
    }
    
    int main(void) {
        WriteFmt("[INFO] Starting StrIter tests\n\n");
        TestFunction tests[] = {
            test_striter_from_zstr_length_and_read,
    
    int main(void) {
        WriteFmt("[INFO] Starting Iter.Deadend tests\n\n");
        TestFunction tests[] = {
            deadend_must_read_eof,
    
    int main(void) {
        WriteFmt("[INFO] Starting Iter tests\n\n");
        TestFunction tests[] = {
            test_iter_remaining_forward,
        };
    
        WriteFmt("[INFO] Starting Map.Ops tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Ops");
    }
        };
    
        WriteFmt("[INFO] Starting Map.Init tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Init");
    }
    // installing the policy, and nothing aborts -> deadend FAILS = mutant killed.
    static bool test_rehash_rejects_invalid_policy(void) {
        WriteFmt("Testing MapRehashWithPolicy validates the new policy up front\n");
    
        typedef Map(int, int) IntIntMap;
    // [n, length), the real code must reject it (length is required).
    static bool test_rehash_rejects_insufficient_with_small_n(void) {
        WriteFmt("Testing MapRehashWithPolicy rejects under-sized capacity for n<length\n");
    
        typedef Map(int, int) IntIntMap;
        };
    
        WriteFmt("[INFO] Starting Map.Insert tests\n\n");
        return run_test_suite(
            tests,
        };
    
        WriteFmt("[INFO] Starting Map.Type tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Type");
    }
    
    static bool test_validate_uninitialized_map_fails(void) {
        WriteFmt("Testing ValidateMap on uninitialized map\n");
    
        Map(int, int) map = {0};
    // `!MAGIC_MATCHES(...)` branch.
    static bool test_validate_map_with_corrupt_magic_fails(void) {
        WriteFmt("Testing ValidateMap with corrupted magic\n");
    
        typedef Map(int, int) IntIntMap;
    
    static bool test_map_contains_pair_without_value_compare_fails(void) {
        WriteFmt("Testing MapContainsPair without value comparator\n");
    
        typedef Map(int, int) IntIntMap;
    
    static bool test_map_remove_pair_without_value_compare_fails(void) {
        WriteFmt("Testing MapRemovePair without value comparator\n");
    
        typedef Map(int, int) IntIntMap;
    
    static bool test_map_remove_if_without_predicate_fails(void) {
        WriteFmt("Testing MapRemoveIf without predicate\n");
    
        typedef Map(int, int) IntIntMap;
    
    static bool test_map_retain_if_without_predicate_fails(void) {
        WriteFmt("Testing MapRetainIf without predicate\n");
    
        typedef Map(int, int) IntIntMap;
    // check dereferences policy, so only the NULL guard can fire here.
    static bool test_validate_map_policy_null_pointer_fails(void) {
        WriteFmt("Testing validate_map_policy(NULL)\n");
    
        validate_map_policy(NULL);
    // name check lets the policy pass cleanly (no later abort).
    static bool test_validate_map_policy_without_name_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without name\n");
    
        MapPolicy policy = valid_baseline_policy();
    // Isolates: missing should_rehash callback.
    static bool test_validate_map_policy_without_should_rehash_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without should_rehash\n");
    
        MapPolicy policy     = valid_baseline_policy();
    // Isolates: missing next_capacity callback.
    static bool test_validate_map_policy_without_next_capacity_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without next_capacity\n");
    
        MapPolicy policy     = valid_baseline_policy();
    // Isolates: missing first_index callback.
    static bool test_validate_map_policy_without_first_index_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without first_index\n");
    
        MapPolicy policy   = valid_baseline_policy();
    // Isolates: missing next_index callback.
    static bool test_validate_map_policy_without_next_index_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without next_index\n");
    
        MapPolicy policy  = valid_baseline_policy();
    // Isolates: max_probe_count == 0 check.
    static bool test_validate_map_policy_without_probe_limit_fails(void) {
        WriteFmt("Testing ValidateMapPolicy without probe limit\n");
    
        MapPolicy policy       = valid_baseline_policy();
    
    static bool test_validate_map_policy_zero_capacity_nonempty_fails(void) {
        WriteFmt("Testing ValidateMapPolicy zero-capacity for non-empty snapshot\n");
    
        MapPolicy policy     = valid_baseline_policy();
    
    static bool test_validate_map_policy_capacity_below_length_fails(void) {
        WriteFmt("Testing ValidateMapPolicy capacity smaller than length\n");
    
        MapPolicy policy     = valid_baseline_policy();
    
    static bool test_validate_map_policy_capacity_below_min_entries_fails(void) {
        WriteFmt("Testing ValidateMapPolicy capacity smaller than min_entries\n");
    
        MapPolicy policy     = valid_baseline_policy();
    
    static bool test_validate_map_policy_first_index_out_of_range_fails(void) {
        WriteFmt("Testing ValidateMapPolicy first_index out of range\n");
    
        MapPolicy policy   = valid_baseline_policy();
    
    static bool test_validate_map_policy_next_index_out_of_range_fails(void) {
        WriteFmt("Testing ValidateMapPolicy next_index out of range\n");
    
        MapPolicy policy  = valid_baseline_policy();
    
    static bool test_validate_map_policy_stuck_probe_fails(void) {
        WriteFmt("Testing ValidateMapPolicy stuck probe sequence\n");
    
        MapPolicy policy  = valid_baseline_policy();
    // would let an invalid-policy map be built silently.
    static bool test_map_init_with_invalid_policy_fails(void) {
        WriteFmt("Testing MapInitWithPolicy with an invalid policy\n");
    
        typedef Map(int, int) IntIntMap;
    // structural validator routes the policy through validate_map_policy.
    static bool test_validate_corrupt_policy_name_fails(void) {
        WriteFmt("Testing ValidateMap with corrupted policy name\n");
    
        typedef Map(int, int) IntIntMap;
    // A map with length > capacity is structurally corrupt and must abort.
    static bool test_validate_length_exceeds_capacity_fails(void) {
        WriteFmt("Testing ValidateMap with length exceeding capacity\n");
    
        typedef Map(int, int) IntIntMap;
        };
    
        WriteFmt("[INFO] Starting Map.Deadend tests\n\n");
        return run_test_suite(
            tests,
        };
    
        WriteFmt("[INFO] Starting Map.Remove tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Remove");
    }
        };
    
        WriteFmt("[INFO] Starting Map.Foreach tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Foreach");
    }
        };
    
        WriteFmt("[INFO] Starting Map.Access tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Map.Access");
    }
    bool test_deadend(TestFunction test_func, bool expect_failure) {
        if (!test_func) {
            WriteFmt("[ERROR] test_deadend: NULL test function provided\n");
            return false;
        }
            bool returned = test_func();
            if (expect_failure) {
                WriteFmt("    [Unexpected success: Test completed without abort]\n");
                test_result = false;    // Expected abort, got clean return.
            } else {
                test_result = false;    // Expected abort, got clean return.
            } else {
                WriteFmt("    [Success: Test completed normally]\n");
                test_result = returned; // Caller's bool is the verdict.
            }
            // Re-entry via longjmp: the test triggered LOG_FATAL.
            if (expect_failure) {
                WriteFmt("    [Expected failure: Test aborted as expected]\n");
                test_result = true; // Abort was the contract.
            } else {
                test_result = true; // Abort was the contract.
            } else {
                WriteFmt("    [Unexpected failure: Test aborted unexpectedly]\n");
                test_result = false;
            }
    int simple_test_driver(TestFunction *tests, int count) {
        if (!tests) {
            WriteFmt("[ERROR] simple_test_driver: NULL tests array provided\n");
            return count; // All tests failed
        }
        // Run all tests and accumulate results
        for (int i = 0; i < count; i++) {
            WriteFmt("[TEST {}/{}] ", i + 1, count);
            bool result = tests[i]();
            if (result) {
            bool result = tests[i]();
            if (result) {
                WriteFmt("[PASS]\n\n");
                passed++;
            } else {
                passed++;
            } else {
                WriteFmt("[FAIL]\n\n");
                failed++;
            }
    
        // Print summary
        WriteFmt("[SUMMARY] Total: {}, Passed: {}, Failed: {}\n", count, passed, failed);
    
        return failed;
    int deadend_test_driver(TestFunction *tests, int count) {
        if (!tests) {
            WriteFmt("[ERROR] deadend_test_driver: NULL tests array provided\n");
            return count; // All tests failed
        }
        }
    
        WriteFmt("\n[INFO] Testing deadend scenarios\n\n");
    
        int passed = 0;
        // Run all deadend tests (expecting failure)
        for (int i = 0; i < count; i++) {
            WriteFmt("[TEST {}/{}] ", i + 1, count);
            bool result = test_deadend(tests[i], true); // All deadend tests expect failure
            if (result) {
            bool result = test_deadend(tests[i], true); // All deadend tests expect failure
            if (result) {
                WriteFmt("[PASS]\n\n");
                passed++;
            } else {
                passed++;
            } else {
                WriteFmt("[FAIL]\n\n");
                failed++;
            }
    
        // Print summary
        WriteFmt("[SUMMARY] Deadend tests - Total: {}, Passed: {}, Failed: {}\n", count, passed, failed);
    
        return failed;
        Zstr          test_name
    ) {
        WriteFmt("[INFO] Starting {} tests\n\n", test_name ? test_name : "Test Suite");
    
        int total_failed = 0;
    
        // Print final summary
        WriteFmt(
            "\n[FINAL SUMMARY] {} - Normal: {} tests, Deadend: {} tests, Total Failed: {}\n",
            test_name ? test_name : "Test Suite",
    
    int main(void) {
        WriteFmt("[INFO] Starting Generics.Variant tests\n\n");
        TestFunction tests[] = {
            test_variant_construct_and_match,
    
    int main(void) {
        WriteFmt("[INFO] Starting Generics.TypeMatch tests\n\n");
        TestFunction tests[] = {
            test_match_dispatch,
    
    int main(void) {
        WriteFmt("[INFO] Starting PdbCache tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Backtrace tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SysDns tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Socket tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting MachoCache tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.SymBind tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.SidecarDwarf tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.SidecarSub tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.Sidecar tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.DwarfFallback tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting SymbolResolver.Bias tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Pe tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Dns tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Pdb tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting ProcMaps tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Http tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting MachO tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Elf tests\n\n");
    
        TestFunction tests[] = {
            // The static marker shouldn't be in .dynsym; if we got a name,
            // either the toolchain exported it or the strip didn't take.
            WriteFmt("[INFO] unexpected ELF symbol hit for static helper: {}\n", sym->name);
        }
    int main(int argc, char **argv) {
        if (argc < 2) {
            WriteFmt("usage: {} <path-to-stripped-binary>\n", argv[0]);
            return 1;
        }
        stripped_path_arg = argv[1];
    
        WriteFmt("[INFO] Stripped-binary resolve test against: {}\n\n", stripped_path_arg);
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting DwarfUnwind tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Dwarf tests\n\n");
    
        TestFunction tests[] = {
    // Test 1: Simple string parsing
    bool test_simple_string_parsing(void) {
        WriteFmt("Testing simple string parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (StrCmp(&name, "Alice", 5) != 0) {
            WriteFmt("[DEBUG] Name check failed: expected 'Alice', got '");
            for (size i = 0; i < StrLen(&name); i++) {
                WriteFmt("{c}", StrBegin(&name)[i]);
            WriteFmt("[DEBUG] Name check failed: expected 'Alice', got '");
            for (size i = 0; i < StrLen(&name); i++) {
                WriteFmt("{c}", StrBegin(&name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (StrCmp(&city, "New York", 8) != 0) {
            WriteFmt("[DEBUG] City check failed: expected 'New York', got '");
            for (size i = 0; i < StrLen(&city); i++) {
                WriteFmt("{c}", StrBegin(&city)[i]);
            WriteFmt("[DEBUG] City check failed: expected 'New York', got '");
            for (size i = 0; i < StrLen(&city); i++) {
                WriteFmt("{c}", StrBegin(&city)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&city)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test 2: Simple number parsing
    bool test_simple_numbers(void) {
        WriteFmt("Testing simple number parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (count != 42) {
            WriteFmt("[DEBUG] Count check failed: expected 42, got {}\n", count);
            success = false;
        }
    
        if (!(score > 95.4 && score < 95.6)) {
            WriteFmt("[DEBUG] Score check failed: expected ~95.5, got {}\n", score);
            success = false;
        }
    
        if (year != 2024) {
            WriteFmt("[DEBUG] Year check failed: expected 2024, got {}\n", year);
            success = false;
        }
    // Test 3: Simple boolean parsing
    bool test_simple_boolean(void) {
        WriteFmt("Testing simple boolean parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (enabled != true) {
            WriteFmt("[DEBUG] Enabled check failed: expected true, got {}\n", enabled ? "true" : "false");
            success = false;
        }
    
        if (visible != false) {
            WriteFmt("[DEBUG] Visible check failed: expected false, got {}\n", visible ? "true" : "false");
            success = false;
        }
    // Test 4: Simple person object
    bool test_simple_person_object(void) {
        WriteFmt("Testing simple person object\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (person.id != 1001) {
            WriteFmt("[DEBUG] Person ID check failed: expected 1001, got {}\n", person.id);
            success = false;
        }
    
        if (StrCmp(&person.name, "Bob", 3) != 0) {
            WriteFmt("[DEBUG] Person name check failed: expected 'Bob', got '");
            for (size i = 0; i < StrLen(&person.name); i++) {
                WriteFmt("{c}", StrBegin(&person.name)[i]);
            WriteFmt("[DEBUG] Person name check failed: expected 'Bob', got '");
            for (size i = 0; i < StrLen(&person.name); i++) {
                WriteFmt("{c}", StrBegin(&person.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&person.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (person.age != 25) {
            WriteFmt("[DEBUG] Person age check failed: expected 25, got {}\n", person.age);
            success = false;
        }
    
        if (person.is_active != true) {
            WriteFmt("[DEBUG] Person is_active check failed: expected true, got {}\n", person.is_active ? "true" : "false");
            success = false;
        }
    
        if (!(person.salary > 49999.0 && person.salary < 50001.0)) {
            WriteFmt("[DEBUG] Person salary check failed: expected ~50000.0, got {}\n", person.salary);
            success = false;
        }
    // Test 5: Simple config object
    bool test_simple_config_object(void) {
        WriteFmt("Testing simple config object\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (config.debug_mode != false) {
            WriteFmt("[DEBUG] Debug mode check failed: expected false, got {}\n", config.debug_mode ? "true" : "false");
            success = false;
        }
    
        if (config.timeout != 30) {
            WriteFmt("[DEBUG] Timeout check failed: expected 30, got {}\n", config.timeout);
            success = false;
        }
    
        if (StrCmp(&config.log_level, "INFO", 4) != 0) {
            WriteFmt("[DEBUG] Log level check failed: expected 'INFO', got '");
            for (size i = 0; i < StrLen(&config.log_level); i++) {
                WriteFmt("{c}", StrBegin(&config.log_level)[i]);
            WriteFmt("[DEBUG] Log level check failed: expected 'INFO', got '");
            for (size i = 0; i < StrLen(&config.log_level); i++) {
                WriteFmt("{c}", StrBegin(&config.log_level)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&config.log_level)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test 6: Simple array of strings
    bool test_simple_array_of_strings(void) {
        WriteFmt("Testing simple array of strings\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (VecLen(&languages) != 3) {
            WriteFmt("[DEBUG] Languages length check failed: expected 3, got {}\n", VecLen(&languages));
            success = false;
        }
    
            if (StrCmp(lang1, "C", 1) != 0) {
                WriteFmt("[DEBUG] Language 1 check failed: expected 'C', got '");
                for (size i = 0; i < StrLen(lang1); i++) {
                    WriteFmt("{c}", StrBegin(lang1)[i]);
                WriteFmt("[DEBUG] Language 1 check failed: expected 'C', got '");
                for (size i = 0; i < StrLen(lang1); i++) {
                    WriteFmt("{c}", StrBegin(lang1)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(lang1)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(lang2, "Python", 6) != 0) {
                WriteFmt("[DEBUG] Language 2 check failed: expected 'Python', got '");
                for (size i = 0; i < StrLen(lang2); i++) {
                    WriteFmt("{c}", StrBegin(lang2)[i]);
                WriteFmt("[DEBUG] Language 2 check failed: expected 'Python', got '");
                for (size i = 0; i < StrLen(lang2); i++) {
                    WriteFmt("{c}", StrBegin(lang2)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(lang2)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(lang3, "Rust", 4) != 0) {
                WriteFmt("[DEBUG] Language 3 check failed: expected 'Rust', got '");
                for (size i = 0; i < StrLen(lang3); i++) {
                    WriteFmt("{c}", StrBegin(lang3)[i]);
                WriteFmt("[DEBUG] Language 3 check failed: expected 'Rust', got '");
                for (size i = 0; i < StrLen(lang3); i++) {
                    WriteFmt("{c}", StrBegin(lang3)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(lang3)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    // Test 7: Simple nested object (1 level)
    bool test_simple_nested_object(void) {
        WriteFmt("Testing simple nested object\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (StrCmp(&data.user.name, "Charlie", 7) != 0) {
            WriteFmt("[DEBUG] User name check failed: expected 'Charlie', got '");
            for (size i = 0; i < StrLen(&data.user.name); i++) {
                WriteFmt("{c}", StrBegin(&data.user.name)[i]);
            WriteFmt("[DEBUG] User name check failed: expected 'Charlie', got '");
            for (size i = 0; i < StrLen(&data.user.name); i++) {
                WriteFmt("{c}", StrBegin(&data.user.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&data.user.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (StrCmp(&data.user.email, "charlie@example.com", 19) != 0) {
            WriteFmt("[DEBUG] User email check failed: expected 'charlie@example.com', got '");
            for (size i = 0; i < StrLen(&data.user.email); i++) {
                WriteFmt("{c}", StrBegin(&data.user.email)[i]);
            WriteFmt("[DEBUG] User email check failed: expected 'charlie@example.com', got '");
            for (size i = 0; i < StrLen(&data.user.email); i++) {
                WriteFmt("{c}", StrBegin(&data.user.email)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&data.user.email)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (data.active != true) {
            WriteFmt("[DEBUG] Active check failed: expected true, got {}\n", data.active ? "true" : "false");
            success = false;
        }
    // Test 8: Simple product with tags array
    bool test_simple_product_with_tags(void) {
        WriteFmt("Testing simple product with tags array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (product.id != 12345) {
            WriteFmt("[DEBUG] Product ID check failed: expected 12345, got {}\n", product.id);
            success = false;
        }
    
        if (StrCmp(&product.name, "Laptop", 6) != 0) {
            WriteFmt("[DEBUG] Product name check failed: expected 'Laptop', got '");
            for (size i = 0; i < StrLen(&product.name); i++) {
                WriteFmt("{c}", StrBegin(&product.name)[i]);
            WriteFmt("[DEBUG] Product name check failed: expected 'Laptop', got '");
            for (size i = 0; i < StrLen(&product.name); i++) {
                WriteFmt("{c}", StrBegin(&product.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&product.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (!(product.price > 999.98 && product.price < 1000.0)) {
            WriteFmt("[DEBUG] Product price check failed: expected ~999.99, got {}\n", product.price);
            success = false;
        }
    
        if (VecLen(&product.tags) != 3) {
            WriteFmt("[DEBUG] Product tags length check failed: expected 3, got {}\n", VecLen(&product.tags));
            success = false;
        }
    
            if (StrCmp(tag1, "electronics", 11) != 0) {
                WriteFmt("[DEBUG] Tag 1 check failed: expected 'electronics', got '");
                for (size i = 0; i < StrLen(tag1); i++) {
                    WriteFmt("{c}", StrBegin(tag1)[i]);
                WriteFmt("[DEBUG] Tag 1 check failed: expected 'electronics', got '");
                for (size i = 0; i < StrLen(tag1); i++) {
                    WriteFmt("{c}", StrBegin(tag1)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(tag1)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(tag2, "computers", 9) != 0) {
                WriteFmt("[DEBUG] Tag 2 check failed: expected 'computers', got '");
                for (size i = 0; i < StrLen(tag2); i++) {
                    WriteFmt("{c}", StrBegin(tag2)[i]);
                WriteFmt("[DEBUG] Tag 2 check failed: expected 'computers', got '");
                for (size i = 0; i < StrLen(tag2); i++) {
                    WriteFmt("{c}", StrBegin(tag2)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(tag2)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(tag3, "portable", 8) != 0) {
                WriteFmt("[DEBUG] Tag 3 check failed: expected 'portable', got '");
                for (size i = 0; i < StrLen(tag3); i++) {
                    WriteFmt("{c}", StrBegin(tag3)[i]);
                WriteFmt("[DEBUG] Tag 3 check failed: expected 'portable', got '");
                for (size i = 0; i < StrLen(tag3); i++) {
                    WriteFmt("{c}", StrBegin(tag3)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(tag3)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
        if (!result) {
            WriteFmtLn("[DEBUG] JSON comparison failed");
            WriteFmt("[DEBUG] Expected: '");
            for (u64 i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            WriteFmt("[DEBUG] Expected: '");
            for (u64 i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            }
            WriteFmtLn("'");
            WriteFmtLn("'");
    
            WriteFmt("[DEBUG] Got: '");
            for (u64 i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("{c}", StrBegin(&output_clean)[i]);
            WriteFmt("[DEBUG] Got: '");
            for (u64 i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("{c}", StrBegin(&output_clean)[i]);
            }
            WriteFmtLn("'");
    
        if (!result) {
            WriteFmt("[DEBUG] JSON comparison failed\n");
            WriteFmt("[DEBUG] Expected: '");
            for (u64 i = 0; i < StrLen(&expected_clean); i++) {
        if (!result) {
            WriteFmt("[DEBUG] JSON comparison failed\n");
            WriteFmt("[DEBUG] Expected: '");
            for (u64 i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            WriteFmt("[DEBUG] Expected: '");
            for (u64 i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            }
            WriteFmt("'\n");
            WriteFmt("[DEBUG] Got: '");
            for (u64 i = 0; i < StrLen(&output_clean); i++) {
            }
            WriteFmt("'\n");
            WriteFmt("[DEBUG] Got: '");
            for (u64 i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("%c", StrBegin(&output_clean)[i]);
            WriteFmt("[DEBUG] Got: '");
            for (u64 i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("%c", StrBegin(&output_clean)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("%c", StrBegin(&output_clean)[i]);
            }
            WriteFmt("'\n");
        }
    // Test 1: Two-level nesting writing
    bool test_two_level_nesting_writing(void) {
        WriteFmt("Testing two-level nesting writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 2: Three-level nesting writing
    bool test_three_level_nesting_writing(void) {
        WriteFmt("Testing three-level nesting writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 3: Complex API response writing
    bool test_complex_api_response_writing(void) {
        WriteFmt("Testing complex API response writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 4: Function info array writing
    bool test_function_info_array_writing(void) {
        WriteFmt("Testing function info array writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 5: Search results with tags writing
    bool test_search_results_with_tags_writing(void) {
        WriteFmt("Testing search results with tags writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 6: Dynamic object keys writing
    bool test_dynamic_object_keys_writing(void) {
        WriteFmt("Testing dynamic object keys writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 7: Deeply nested structure writing
    bool test_deeply_nested_structure_writing(void) {
        WriteFmt("Testing deeply nested structure writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 8: Mixed array types writing
    bool test_mixed_array_types_writing(void) {
        WriteFmt("Testing mixed array types writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test basic iterator functionality
    bool test_basic_iterator_functionality(void) {
        WriteFmt("Testing basic iterator functionality\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (!StrIterRemainingLength(&si)) {
            WriteFmt("[DEBUG] Remaining length check failed: expected > 0, got {}\n", StrIterRemainingLength(&si));
            success = false;
        }
        char c = '\0';
        if (!StrIterPeek(&si, &c) || c != '{') {
            WriteFmt("[DEBUG] Peek check failed: expected '{', got '{c}'\n", c);
            success = false;
        }
    // Test simple JSON object (1 level)
    bool test_simple_json_object(void) {
        WriteFmt("Testing simple JSON object (1 level)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (data.id != 12345) {
            WriteFmt("[DEBUG] ID check failed: expected 12345, got {}\n", data.id);
            success = false;
        }
    
        if (StrCmp(&data.name, "test", 4) != 0) {
            WriteFmt("[DEBUG] Name check failed: expected 'test', got '");
            for (size i = 0; i < StrLen(&data.name); i++) {
                WriteFmt("{c}", StrBegin(&data.name)[i]);
            WriteFmt("[DEBUG] Name check failed: expected 'test', got '");
            for (size i = 0; i < StrLen(&data.name); i++) {
                WriteFmt("{c}", StrBegin(&data.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&data.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (data.active != true) {
            WriteFmt("[DEBUG] Active check failed: expected true, got {}\n", data.active ? "true" : "false");
            success = false;
        }
    
        if (!(data.score > 98.4 && data.score < 98.6)) {
            WriteFmt("[DEBUG] Score check failed: expected 98.4-98.6, got {}\n", data.score);
            success = false;
        }
    // Test two-level nesting
    bool test_two_level_nesting(void) {
        WriteFmt("Testing two-level nesting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (data.user.id != 123) {
            WriteFmt("[DEBUG] User ID check failed: expected 123, got {}\n", data.user.id);
            success = false;
        }
    
        if (StrCmp(&data.user.profile.name, "Alice", 5) != 0) {
            WriteFmt("[DEBUG] Profile name check failed: expected 'Alice', got '");
            for (u64 i = 0; i < StrLen(&data.user.profile.name); i++) {
                WriteFmt("{}", StrBegin(&data.user.profile.name)[i]);
            WriteFmt("[DEBUG] Profile name check failed: expected 'Alice', got '");
            for (u64 i = 0; i < StrLen(&data.user.profile.name); i++) {
                WriteFmt("{}", StrBegin(&data.user.profile.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{}", StrBegin(&data.user.profile.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (data.user.profile.age != 30) {
            WriteFmt("[DEBUG] Profile age check failed: expected 30, got {}\n", data.user.profile.age);
            success = false;
        }
    
        if (StrCmp(&data.status, "active", 6) != 0) {
            WriteFmt("[DEBUG] Status check failed: expected 'active', got '");
            for (size i = 0; i < StrLen(&data.status); i++) {
                WriteFmt("{}", StrBegin(&data.status)[i]);
            WriteFmt("[DEBUG] Status check failed: expected 'active', got '");
            for (size i = 0; i < StrLen(&data.status); i++) {
                WriteFmt("{}", StrBegin(&data.status)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{}", StrBegin(&data.status)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test three-level nesting
    bool test_three_level_nesting(void) {
        WriteFmt("Testing three-level nesting\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (StrCmp(&data.company.departments.engineering.head, "John", 4) != 0) {
            WriteFmt("[DEBUG] Engineering head check failed: expected 'John', got '");
            for (size i = 0; i < StrLen(&data.company.departments.engineering.head); i++) {
                WriteFmt("{c}", StrBegin(&data.company.departments.engineering.head)[i]);
            WriteFmt("[DEBUG] Engineering head check failed: expected 'John', got '");
            for (size i = 0; i < StrLen(&data.company.departments.engineering.head); i++) {
                WriteFmt("{c}", StrBegin(&data.company.departments.engineering.head)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&data.company.departments.engineering.head)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (data.company.departments.engineering.count != 25) {
            WriteFmt(
                "[DEBUG] Engineering count check failed: expected 25, got {}\n",
                data.company.departments.engineering.count
    
        if (data.company.departments.engineering.budget < 149999.0) {
            WriteFmt(
                "[DEBUG] Engineering budget check failed: expected > 149999.0, got {}\n",
                data.company.departments.engineering.budget
    
        if (StrCmp(&data.company.name, "TechCorp", 8) != 0) {
            WriteFmt("[DEBUG] Company name check failed: expected 'TechCorp', got '");
            for (size i = 0; i < StrLen(&data.company.name); i++) {
                WriteFmt("{c}", StrBegin(&data.company.name)[i]);
            WriteFmt("[DEBUG] Company name check failed: expected 'TechCorp', got '");
            for (size i = 0; i < StrLen(&data.company.name); i++) {
                WriteFmt("{c}", StrBegin(&data.company.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&data.company.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test dynamic key parsing (like your example) - Fixed initialization
    bool test_dynamic_key_parsing(void) {
        WriteFmt("Testing dynamic key parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (VecLen(&symbols) != 2) {
            WriteFmt("[DEBUG] Symbols length check failed: expected 2, got {}\n", VecLen(&symbols));
            success = false;
        }
    
            if (!(sym1->source_function_id == 12345 || sym1->source_function_id == 54321)) {
                WriteFmt(
                    "[DEBUG] Sym1 source function ID check failed: expected 12345 or 54321, got {}\n",
                    sym1->source_function_id
    
            if (!(sym1->target_function_id == 67890 || sym1->target_function_id == 98765)) {
                WriteFmt(
                    "[DEBUG] Sym1 target function ID check failed: expected 67890 or 98765, got {}\n",
                    sym1->target_function_id
    
            if (!(sym1->distance > 0.8 && sym1->distance < 1.0)) {
                WriteFmt("[DEBUG] Sym1 distance check failed: expected 0.8-1.0, got {}\n", sym1->distance);
                success = false;
            }
    
            if (!(sym2->source_function_id == 12345 || sym2->source_function_id == 54321)) {
                WriteFmt(
                    "[DEBUG] Sym2 source function ID check failed: expected 12345 or 54321, got {}\n",
                    sym2->source_function_id
    
            if (!(sym2->target_function_id == 67890 || sym2->target_function_id == 98765)) {
                WriteFmt(
                    "[DEBUG] Sym2 target function ID check failed: expected 67890 or 98765, got {}\n",
                    sym2->target_function_id
    
            if (!(sym2->distance > 0.8 && sym2->distance < 1.0)) {
                WriteFmt("[DEBUG] Sym2 distance check failed: expected 0.8-1.0, got {}\n", sym2->distance);
                success = false;
            }
    // Test complex API response similar to your example - Fixed initialization
    bool test_complex_api_response(void) {
        WriteFmt("Testing complex API response structure\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        // Debug status check
        if (response.status != true) {
            WriteFmt("[DEBUG] Status check failed: expected true, got {}\n", response.status ? "true" : "false");
            success = false;
        }
        // Debug message check
        if (StrCmp(&response.message, "Success", 7) != 0) {
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
        // Debug data length check
        if (VecLen(&response.data) != 1) {
            WriteFmt("[DEBUG] Data length check failed: expected 1, got {}\n", VecLen(&response.data));
            success = false;
        }
            // Debug individual symbol checks
            if (sym->source_function_id != 12345) {
                WriteFmt("[DEBUG] Source function ID check failed: expected 12345, got {}\n", sym->source_function_id);
                success = false;
            }
    
            if (sym->target_function_id != 67890) {
                WriteFmt("[DEBUG] Target function ID check failed: expected 67890, got {}\n", sym->target_function_id);
                success = false;
            }
    
            if (!(sym->distance > 0.84 && sym->distance < 0.86)) {
                WriteFmt("[DEBUG] Distance check failed: expected 0.84-0.86, got {}\n", sym->distance);
                success = false;
            }
    
            if (sym->analysis_id != 999) {
                WriteFmt("[DEBUG] Analysis ID check failed: expected 999, got {}\n", sym->analysis_id);
                success = false;
            }
    
            if (sym->binary_id != 888) {
                WriteFmt("[DEBUG] Binary ID check failed: expected 888, got {}\n", sym->binary_id);
                success = false;
            }
    
            if (StrCmp(&sym->analysis_name, "test_analysis", 13) != 0) {
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(&sym->function_name, "main_func", 9) != 0) {
                WriteFmt(
                    "[DEBUG] Function name check failed: expected 'main_func', got string of length {}\n",
                    StrLen(&sym->function_name)
    
            if (StrCmp(&sym->sha256, "abc123", 6) != 0) {
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (sym->debug != true) {
                WriteFmt("[DEBUG] Debug flag check failed: expected true, got {}\n", sym->debug ? "true" : "false");
                success = false;
            }
    
            if (StrCmp(&sym->function_mangled_name, "_Z4main", 7) != 0) {
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    // Test function info parsing
    bool test_function_info_parsing(void) {
        WriteFmt("Testing function info parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (info.id != 12345) {
            WriteFmt("[DEBUG] Function ID check failed: expected 12345, got {}\n", info.id);
            success = false;
        }
    
        if (StrCmp(&info.name, "test_func", 9) != 0) {
            WriteFmt("[DEBUG] Function name check failed: expected 'test_func', got '");
            for (size i = 0; i < StrLen(&info.name); i++) {
                WriteFmt("{}", StrBegin(&info.name)[i]);
            WriteFmt("[DEBUG] Function name check failed: expected 'test_func', got '");
            for (size i = 0; i < StrLen(&info.name); i++) {
                WriteFmt("{}", StrBegin(&info.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{}", StrBegin(&info.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (info.size != 1024) {
            WriteFmt("[DEBUG] Function size check failed: expected 1024, got {}\n", info.size);
            success = false;
        }
    
        if (info.vaddr != 4096) {
            WriteFmt("[DEBUG] Function vaddr check failed: expected 4096, got {}\n", info.vaddr);
            success = false;
        }
    // Test model info parsing
    bool test_model_info_parsing(void) {
        WriteFmt("Testing model info parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (info.id != 54321) {
            WriteFmt("[DEBUG] Model ID check failed: expected 54321, got {}\n", info.id);
            success = false;
        }
    
        if (StrCmp(&info.name, "test_model", 10) != 0) {
            WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
            for (size i = 0; i < StrLen(&info.name); i++) {
                WriteFmt("{}", StrBegin(&info.name)[i]);
            WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
            for (size i = 0; i < StrLen(&info.name); i++) {
                WriteFmt("{}", StrBegin(&info.name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{}", StrBegin(&info.name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test search results with tags - Fixed implementation
    bool test_search_results_with_tags(void) {
        WriteFmt("Testing search results with tags\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (result.binary_id != 888) {
            WriteFmt("[DEBUG] Binary ID check failed: expected 888, got {}\n", result.binary_id);
            success = false;
        }
    
        if (StrCmp(&result.binary_name, "test_binary", 11) != 0) {
            WriteFmt("[DEBUG] Binary name check failed: expected 'test_binary', got '");
            for (size i = 0; i < StrLen(&result.binary_name); i++) {
                WriteFmt("{c}", StrBegin(&result.binary_name)[i]);
            WriteFmt("[DEBUG] Binary name check failed: expected 'test_binary', got '");
            for (size i = 0; i < StrLen(&result.binary_name); i++) {
                WriteFmt("{c}", StrBegin(&result.binary_name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result.binary_name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (result.analysis_id != 999) {
            WriteFmt("[DEBUG] Analysis ID check failed: expected 999, got {}\n", result.analysis_id);
            success = false;
        }
    
        if (StrCmp(&result.sha256, "abc123", 6) != 0) {
            WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
            for (size i = 0; i < StrLen(&result.sha256); i++) {
                WriteFmt("{c}", StrBegin(&result.sha256)[i]);
            WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
            for (size i = 0; i < StrLen(&result.sha256); i++) {
                WriteFmt("{c}", StrBegin(&result.sha256)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result.sha256)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (result.model_id != 12345) {
            WriteFmt("[DEBUG] Model ID check failed: expected 12345, got {}\n", result.model_id);
            success = false;
        }
    
        if (StrCmp(&result.model_name, "test_model", 10) != 0) {
            WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
            for (size i = 0; i < StrLen(&result.model_name); i++) {
                WriteFmt("{c}", StrBegin(&result.model_name)[i]);
            WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
            for (size i = 0; i < StrLen(&result.model_name); i++) {
                WriteFmt("{c}", StrBegin(&result.model_name)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result.model_name)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (StrCmp(&result.owned_by, "user1", 5) != 0) {
            WriteFmt("[DEBUG] Owned by check failed: expected 'user1', got '");
            for (size i = 0; i < StrLen(&result.owned_by); i++) {
                WriteFmt("{c}", StrBegin(&result.owned_by)[i]);
            WriteFmt("[DEBUG] Owned by check failed: expected 'user1', got '");
            for (size i = 0; i < StrLen(&result.owned_by); i++) {
                WriteFmt("{c}", StrBegin(&result.owned_by)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&result.owned_by)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    // Test conditional parsing
    bool test_conditional_parsing(void) {
        WriteFmt("Testing conditional parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        ApiResponse response = {false, StrInit(&alloc), VecInitWithDeepCopy(NULL, AnnSymbolDeinit, &alloc)};
    
        WriteFmt("[DEBUG] About to parse JSON...\n");
    
        JR_OBJ(si, {
            JR_STR_KV(si, "message", response.message);
    
            WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
    
            if (response.status) {
    
            if (response.status) {
                WriteFmt("[DEBUG] Status is true, parsing data...\n");
                JR_OBJ_KV(si, "data", {
                    u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
                JR_OBJ_KV(si, "data", {
                    u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
                    WriteFmt("[DEBUG] Source function ID from key: {}\n", source_function_id);
                    JR_OBJ(si, {
                        // Properly initialize all Str fields
                        sym.target_function_id    = (u64)ZstrToI64(StrBegin(&key), NULL);
    
                        WriteFmt("[DEBUG] Target function ID from key: {}\n", sym.target_function_id);
    
                        JR_OBJ(si, {
                        });
    
                        WriteFmt(
                            "[DEBUG] Parsed symbol - distance: {}, analysis_id: {}, binary_id: {}\n",
                            sym.distance,
    
                        VecPushBack(&response.data, sym);
                        WriteFmt("[DEBUG] Added symbol to vector, length now: {}\n", VecLen(&response.data));
                    });
                });
                });
            } else {
                WriteFmt("[DEBUG] Status is false, skipping data parsing\n");
            }
        });
        });
    
        WriteFmt("[DEBUG] Finished parsing, response.data length = {}\n", VecLen(&response.data));
    
        // Debug checks
        // Debug checks
        if (response.status != true) {
            WriteFmt("[DEBUG] Status check failed: expected true, got {}\n", response.status ? "true" : "false");
            success = false;
        }
    
        if (StrCmp(&response.message, "Success", 7) != 0) {
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (VecLen(&response.data) != 1) {
            WriteFmt("[DEBUG] Data length check failed: expected 1, got {}\n", VecLen(&response.data));
            success = false;
        }
    
            if (sym->source_function_id != 12345) {
                WriteFmt("[DEBUG] Source function ID check failed: expected 12345, got {}\n", sym->source_function_id);
                success = false;
            }
    
            if (sym->target_function_id != 67890) {
                WriteFmt("[DEBUG] Target function ID check failed: expected 67890, got {}\n", sym->target_function_id);
                success = false;
            }
    
            if (!(sym->distance > 0.84 && sym->distance < 0.86)) {
                WriteFmt("[DEBUG] Distance check failed: expected 0.84-0.86, got {}\n", sym->distance);
                success = false;
            }
    
            if (sym->analysis_id != 999) {
                WriteFmt("[DEBUG] Analysis ID check failed: expected 999, got {}\n", sym->analysis_id);
                success = false;
            }
    
            if (sym->binary_id != 888) {
                WriteFmt("[DEBUG] Binary ID check failed: expected 888, got {}\n", sym->binary_id);
                success = false;
            }
    
            if (StrCmp(&sym->analysis_name, "test_analysis", 13) != 0) {
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(&sym->function_name, "main_func", 9) != 0) {
                WriteFmt(
                    "[DEBUG] Function name check failed: expected 'main_func', got string of length {}\n",
                    StrLen(&sym->function_name)
    
            if (StrCmp(&sym->sha256, "abc123", 6) != 0) {
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (sym->debug != true) {
                WriteFmt("[DEBUG] Debug flag check failed: expected true, got {}\n", sym->debug ? "true" : "false");
                success = false;
            }
    
            if (StrCmp(&sym->function_mangled_name, "_Z4main", 7) != 0) {
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    // Test status response pattern
    bool test_status_response_pattern(void) {
        WriteFmt("Testing status response pattern\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        ApiResponse response = {false, StrInit(&alloc), VecInitWithDeepCopy(NULL, AnnSymbolDeinit, &alloc)};
    
        WriteFmt("[DEBUG] About to parse JSON...\n");
    
        JR_OBJ(si, {
            JR_STR_KV(si, "message", response.message);
    
            WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
            for (size i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
    
            if (response.status) {
    
            if (response.status) {
                WriteFmt("[DEBUG] Status is true, parsing data...\n");
                JR_OBJ_KV(si, "data", {
                    u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
                JR_OBJ_KV(si, "data", {
                    u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
                    WriteFmt("[DEBUG] Source function ID from key: {}\n", source_function_id);
                    JR_OBJ(si, {
                        // Properly initialize all Str fields
                        sym.target_function_id    = (u64)ZstrToI64(StrBegin(&key), NULL);
    
                        WriteFmt("[DEBUG] Target function ID from key: {}\n", sym.target_function_id);
    
                        JR_OBJ(si, {
                        });
    
                        WriteFmt(
                            "[DEBUG] Parsed symbol - distance: {}, analysis_id: {}, binary_id: {}\n",
                            sym.distance,
    
                        VecPushBack(&response.data, sym);
                        WriteFmt("[DEBUG] Added symbol to vector, length now: {}\n", VecLen(&response.data));
                    });
                });
                });
            } else {
                WriteFmt("[DEBUG] Status is false, skipping data parsing\n");
            }
        });
        });
    
        WriteFmt("[DEBUG] Finished parsing, response.data length = {}\n", VecLen(&response.data));
    
        // Debug checks
        // Debug checks
        if (response.status != true) {
            WriteFmt("[DEBUG] Status check failed: expected true, got {}\n", response.status ? "true" : "false");
            success = false;
        }
    
        if (StrCmp(&response.message, "Success", 7) != 0) {
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (u64 i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
            for (u64 i = 0; i < StrLen(&response.message); i++) {
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&response.message)[i]);
            }
            WriteFmt("'\n");
            success = false;
        }
    
        if (VecLen(&response.data) != 1) {
            WriteFmt("[DEBUG] Data length check failed: expected 1, got {}\n", VecLen(&response.data));
            success = false;
        }
    
            if (sym->source_function_id != 12345) {
                WriteFmt("[DEBUG] Source function ID check failed: expected 12345, got {}\n", sym->source_function_id);
                success = false;
            }
    
            if (sym->target_function_id != 67890) {
                WriteFmt("[DEBUG] Target function ID check failed: expected 67890, got {}\n", sym->target_function_id);
                success = false;
            }
    
            if (!(sym->distance > 0.84 && sym->distance < 0.86)) {
                WriteFmt("[DEBUG] Distance check failed: expected 0.84-0.86, got {}\n", sym->distance);
                success = false;
            }
    
            if (sym->analysis_id != 999) {
                WriteFmt("[DEBUG] Analysis ID check failed: expected 999, got {}\n", sym->analysis_id);
                success = false;
            }
    
            if (sym->binary_id != 888) {
                WriteFmt("[DEBUG] Binary ID check failed: expected 888, got {}\n", sym->binary_id);
                success = false;
            }
    
            if (StrCmp(&sym->analysis_name, "test_analysis", 13) != 0) {
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{}", StrBegin(&sym->analysis_name)[i]);
                WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
                for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
                    WriteFmt("{}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{}", StrBegin(&sym->analysis_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(&sym->function_name, "main_func", 9) != 0) {
                WriteFmt("[DEBUG] Function name check failed: expected 'main_func', got '");
                for (size i = 0; i < StrLen(&sym->function_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_name)[i]);
                WriteFmt("[DEBUG] Function name check failed: expected 'main_func', got '");
                for (size i = 0; i < StrLen(&sym->function_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->function_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (StrCmp(&sym->sha256, "abc123", 6) != 0) {
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{}", StrBegin(&sym->sha256)[i]);
                WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
                for (size i = 0; i < StrLen(&sym->sha256); i++) {
                    WriteFmt("{}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{}", StrBegin(&sym->sha256)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
            if (sym->debug != true) {
                WriteFmt("[DEBUG] Debug flag check failed: expected true, got {}\n", sym->debug ? "true" : "false");
                success = false;
            }
    
            if (StrCmp(&sym->function_mangled_name, "_Z4main", 7) != 0) {
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
                for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                    WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
                }
                WriteFmt("'\n");
                success = false;
            }
    
        if (!result) {
            WriteFmt("[DEBUG] JSON comparison failed\n");
            WriteFmt("[DEBUG] Expected: '");
            for (size i = 0; i < StrLen(&expected_clean); i++) {
        if (!result) {
            WriteFmt("[DEBUG] JSON comparison failed\n");
            WriteFmt("[DEBUG] Expected: '");
            for (size i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            WriteFmt("[DEBUG] Expected: '");
            for (size i = 0; i < StrLen(&expected_clean); i++) {
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&expected_clean)[i]);
            }
            WriteFmt("'\n");
            WriteFmt("[DEBUG] Got: '");
            for (size i = 0; i < StrLen(&output_clean); i++) {
            }
            WriteFmt("'\n");
            WriteFmt("[DEBUG] Got: '");
            for (size i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("{c}", StrBegin(&output_clean)[i]);
            WriteFmt("[DEBUG] Got: '");
            for (size i = 0; i < StrLen(&output_clean); i++) {
                WriteFmt("{c}", StrBegin(&output_clean)[i]);
            }
            WriteFmt("'\n");
                WriteFmt("{c}", StrBegin(&output_clean)[i]);
            }
            WriteFmt("'\n");
        }
    // Test 1: Simple string writing
    bool test_simple_string_writing(void) {
        WriteFmt("Testing simple string writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 2: Simple number writing
    bool test_simple_numbers_writing(void) {
        WriteFmt("Testing simple number writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 3: Simple boolean writing
    bool test_simple_boolean_writing(void) {
        WriteFmt("Testing simple boolean writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 4: Simple person object writing
    bool test_simple_person_object_writing(void) {
        WriteFmt("Testing simple person object writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 5: Simple config object writing
    bool test_simple_config_object_writing(void) {
        WriteFmt("Testing simple config object writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 6: Simple array of strings writing
    bool test_simple_array_of_strings_writing(void) {
        WriteFmt("Testing simple array of strings writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 7: Simple nested object writing
    bool test_simple_nested_object_writing(void) {
        WriteFmt("Testing simple nested object writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 8: Simple product with tags array writing
    bool test_simple_product_with_tags_writing(void) {
        WriteFmt("Testing simple product with tags array writing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 3: Empty string reading
    bool test_empty_string_reading(void) {
        WriteFmt("Testing empty string reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (StrLen(&obj.name) == 0 && StrLen(&obj.description) == 0) {
            WriteFmt("[DEBUG] Empty string test passed - both strings empty\n");
        } else {
            WriteFmt(
            WriteFmt("[DEBUG] Empty string test passed - both strings empty\n");
        } else {
            WriteFmt(
                "[DEBUG] Empty string test FAILED - name len: {}, desc len: {}\n",
                StrLen(&obj.name),
    // Test 4: Negative numbers reading
    bool test_negative_numbers_reading(void) {
        WriteFmt("Testing negative numbers reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (obj.temp == -25 && obj.balance == -1000.50 && obj.delta == -0.001) {
            WriteFmt(
                "[DEBUG] Negative numbers test passed - temp: {}, balance: {}, delta: {}\n",
                obj.temp,
            );
        } else {
            WriteFmt(
                "[DEBUG] Negative numbers test FAILED - temp: {}, balance: {}, delta: {}\n",
                obj.temp,
    // Test 5: Large numbers reading
    bool test_large_numbers_reading(void) {
        WriteFmt("Testing large numbers reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (obj.big_int == 9223372036854775807LL) {
            WriteFmt("[DEBUG] Large integer test passed: {}\n", obj.big_int);
        } else {
            WriteFmt("[DEBUG] Large integer test FAILED: expected 9223372036854775807, got {}\n", obj.big_int);
            WriteFmt("[DEBUG] Large integer test passed: {}\n", obj.big_int);
        } else {
            WriteFmt("[DEBUG] Large integer test FAILED: expected 9223372036854775807, got {}\n", obj.big_int);
            success = false;
        }
        // Check if floats are in reasonable range (may not be exact due to precision)
        if (obj.big_float > 1.0e+300 && obj.small_float > 0 && obj.small_float < 1.0e-300) {
            WriteFmt("[DEBUG] Large float test passed\n");
        } else {
            WriteFmt("[DEBUG] Large float test FAILED - big: {e}, small: {e}\n", obj.big_float, obj.small_float);
            WriteFmt("[DEBUG] Large float test passed\n");
        } else {
            WriteFmt("[DEBUG] Large float test FAILED - big: {e}, small: {e}\n", obj.big_float, obj.small_float);
            success = false;
        }
    // Test 6: Zero values reading
    bool test_zero_values_reading(void) {
        WriteFmt("Testing zero values reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (obj.int_zero == 0 && obj.float_zero == 0.0 && obj.bool_false == false) {
            WriteFmt(
                "[DEBUG] Zero values test passed - int: {}, float: {}, bool: {}\n",
                obj.int_zero,
            );
        } else {
            WriteFmt(
                "[DEBUG] Zero values test FAILED - int: {}, float: {}, bool: {}\n",
                obj.int_zero,
    // Test 7: Special characters in strings
    bool test_special_characters_in_strings(void) {
        WriteFmt("Testing special characters in strings\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        });
    
        WriteFmt("[DEBUG] Special chars - path: '{}'\n", obj.path);
        WriteFmt("[DEBUG] Special chars - message: '{}'\n", obj.message);
        WriteFmt("[DEBUG] Special chars - data: '{}'\n", obj.data);
    
        WriteFmt("[DEBUG] Special chars - path: '{}'\n", obj.path);
        WriteFmt("[DEBUG] Special chars - message: '{}'\n", obj.message);
        WriteFmt("[DEBUG] Special chars - data: '{}'\n", obj.data);
        WriteFmt("[DEBUG] Special chars - path: '{}'\n", obj.path);
        WriteFmt("[DEBUG] Special chars - message: '{}'\n", obj.message);
        WriteFmt("[DEBUG] Special chars - data: '{}'\n", obj.data);
    
        // Decoded content is caller-observable -- assert exact bytes, not just
    // Test 8: Escape sequences reading
    bool test_escape_sequences_reading(void) {
        WriteFmt("Testing escape sequences reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test 9: Whitespace variations reading
    bool test_whitespace_variations_reading(void) {
        WriteFmt("Testing whitespace variations reading\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (StrCmp(&obj.name, "test", 4) == 0 && obj.value == 42 && obj.flag == true) {
            WriteFmt(
                "[DEBUG] Whitespace variations test passed - name: {}, value: {}, flag: {}\n",
                StrBegin(&obj.name),
            );
        } else {
            WriteFmt(
                "[DEBUG] Whitespace variations test FAILED - name: {}, value: {}, flag: {}\n",
                StrBegin(&obj.name),
        // found_inner should be true (empty inner object still triggers JR_OBJ_KV)
        if (!obj.found_outer && !obj.found_list && obj.found_deep && !obj.found_inner) {
            WriteFmt("[DEBUG] Nested empty containers test passed\n");
        } else {
            WriteFmt(
            WriteFmt("[DEBUG] Nested empty containers test passed\n");
        } else {
            WriteFmt(
                "[DEBUG] Nested empty containers test results - outer: {}, list: {}, deep: {}, inner: {}\n",
                obj.found_outer ? "true" : "false",
    // Test 11: Mixed empty and filled containers
    bool test_mixed_empty_and_filled(void) {
        WriteFmt("Testing mixed empty and filled containers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        if (obj.x_value == 1 && VecLen(&obj.filled_items) == 2 && VecAt(&obj.filled_items, 0) == 1 &&
            VecAt(&obj.filled_items, 1) == 2) {
            WriteFmt(
                "[DEBUG] Mixed empty and filled test passed - x: {}, items: {}\n",
                obj.x_value,
            );
        } else {
            WriteFmt(
                "[DEBUG] Mixed empty and filled test FAILED - x: {}, items: {}\n",
                obj.x_value,
            );
            if (VecLen(&obj.filled_items) > 0) {
                WriteFmt("[DEBUG] First item: {}\n", VecAt(&obj.filled_items, 0));
            }
            success = false;
    // Test 12: Boundary integers
    bool test_boundary_integers(void) {
        WriteFmt("Testing boundary integers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (obj.max_int == 2147483647LL && obj.min_int == -2147483648LL && obj.one == 1 && obj.minus_one == -1) {
            WriteFmt(
                "[DEBUG] Boundary integers test passed - max: {}, min: {}, one: {}, minus_one: {}\n",
                obj.max_int,
            );
        } else {
            WriteFmt(
                "[DEBUG] Boundary integers test FAILED - max: {}, min: {}, one: {}, minus_one: {}\n",
                obj.max_int,
    // Test 13: Boundary floats
    bool test_boundary_floats(void) {
        WriteFmt("Testing boundary floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        if (obj.tiny > 0.0000001 && obj.tiny < 0.00001 && obj.huge > 999999.0 && obj.huge < 1000000.0 && obj.zero == 0.0 &&
            obj.negative_tiny < -0.0000001 && obj.negative_tiny > -0.00001) {
            WriteFmt(
                "[DEBUG] Boundary floats test passed - tiny: {}, huge: {}, zero: {}, neg_tiny: {}\n",
                obj.tiny,
            );
        } else {
            WriteFmt(
                "[DEBUG] Boundary floats test FAILED - tiny: {}, huge: {}, zero: {}, neg_tiny: {}\n",
                obj.tiny,
        };
    
        WriteFmt("[INFO] Starting KvConfig.Parse tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "KvConfig.Parse");
    }
Last updated on