summaryrefslogtreecommitdiff
path: root/tests/snapshot_failure_test.c
AgeCommit message (Collapse)Author
10 daysKeep the snapshot unchanged when an update failsBerke Güzel
term_snapshot_update converted the viewport in place, so an allocation that failed midway left the snapshot empty and a renderer painted a blank frame. Split the update into two phases. Phase 1 makes every allocation the update needs and counts the arena words the converted rows add, then grows the arena once. Phase 2 writes the view, cells, keys, clusters, and selection, and cannot fail. A failed update now keeps the previous content, and a retry is an ordinary incremental update. invalidate() is removed. The term_snapshot_update comment and the correctness audit now say the snapshot keeps its previous content. The failure test fails each allocation in turn from the same starting state. After every failed call it compares the view, cells, row keys, selection spans, and cluster code points with the state before the call. A retry must succeed and match a fresh capture. The cases are a first update, a 32 by 16 screen of ZWJ families and regional-indicator flags (arena growth), a resize, a 300-row screen (scratch arrays), and a long scroll run. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
10 daysFix snapshot failure test under LTOBerke Güzel
10 daysFix snapshot storage and allocation failure correctnessBerke Güzel
Account for cluster records discarded by snapshot scrolling, propagate snapshot allocation failures with an empty retryable view, and allocate resized screens before mutating visible state. Add bounded-memory and allocation-failure regressions, and update the saved diagnostic and audit report.