summaryrefslogtreecommitdiff
path: root/tests/resize_failure_test.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 13:04:01 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 13:04:01 +0300
commitdcebf9c7f954a55350b68d0ead1935612c4e2e05 (patch)
tree3eb3e9f6154c6760bcb89a565f8ddc8f8b66cb90 /tests/resize_failure_test.c
parentbd8222e615134c3ec5e7a07b6b1fa97c9bd4a471 (diff)
Rename the library to wsap_vtcore
ncurses installs <term.h> and defines struct term. In a file that includes both headers, an ncurses TERMINAL * and this library's terminal are silently the same type. The name wsap_vtcore avoids the clash. The public header is now <wsap_vtcore/wsap_vtcore.h>. Every global symbol uses the wsap_vtcore_ prefix, every macro uses WSAP_VTCORE_, and the shared library is libwsap_vtcore.so.0. The default terminal name is now "wsap_vtcore". The ISA override variable is WSAP_VTCORE_ISA. No other behavior changes. The amalgamation writes wsap_vtcore.c and wsap_vtcore.h. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/resize_failure_test.c')
-rw-r--r--tests/resize_failure_test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/resize_failure_test.c b/tests/resize_failure_test.c
index fbfa38d..0074f56 100644
--- a/tests/resize_failure_test.c
+++ b/tests/resize_failure_test.c
@@ -52,7 +52,7 @@ int main(void)
puts("resize failure test skipped under sanitizer");
return 0;
#else
- struct term *term = tt_new(10, 2);
+ struct wsap_vtcore *term = tt_new(10, 2);
assert(term);
tt_write(term, "abc", 3);
@@ -79,7 +79,7 @@ int main(void)
assert(tt_cols(term) == 20);
assert(tt_rows(term) == 2);
assert(tt_cell(term, 0, 0)->text == '1');
- term_free(term);
+ wsap_vtcore_free(term);
term = tt_new(10, 3);
assert(term);
@@ -96,7 +96,7 @@ int main(void)
assert(tt_cell(term, 4, 0)->text == 'e');
assert(tt_cell(term, 5, 0)->text != 'f');
assert(tt_cell(term, 0, 1)->text == 'f');
- term_free(term);
+ wsap_vtcore_free(term);
term = tt_new(10, 2);
assert(term);
@@ -106,12 +106,12 @@ int main(void)
assert(!fail_next_calloc);
/* A failed alternate-screen allocation keeps the normal screen active. */
- assert(!term_modes(term).alternate);
+ assert(!wsap_vtcore_modes(term).alternate);
assert(tt_cell(term, 0, 0)->text == 'n');
assert(tt_cell(term, 5, 0)->text == 'l');
tt_write(term, "\033[?1049l", 8);
assert(tt_cell(term, 0, 0)->text == 'n');
- term_free(term);
+ wsap_vtcore_free(term);
/* A reflow that cannot grow its row buffers fails before it changes the
* history, so the old geometry and text survive the failed resize. The
@@ -144,7 +144,7 @@ int main(void)
resized = tt_resize(term, 10, 40);
assert(resized);
assert(tt_cols(term) == 10);
- term_free(term);
+ wsap_vtcore_free(term);
/* A failed same-width height shrink must not scroll rows into history or
* move the cursor. The same resize must succeed when allocation recovers. */
@@ -174,14 +174,14 @@ int main(void)
assert(tt_cell(term, 0, 1)->text == 'D');
assert(tt_cursor_y(term) == 1);
assert(tt_history(term) == 2);
- term_free(term);
+ wsap_vtcore_free(term);
/* The alternate screen uses the same allocation-before-scroll path. */
term = tt_new(8, 4);
assert(term);
tt_write(term, "\033[?1049h", 8);
tt_write(term, four_rows, sizeof four_rows - 1);
- assert(term_modes(term).alternate);
+ assert(wsap_vtcore_modes(term).alternate);
assert(tt_cursor_y(term) == 3);
fail_next_calloc = true;
resized = tt_resize(term, 8, 2);
@@ -195,7 +195,7 @@ int main(void)
assert(tt_rows(term) == 2 && tt_cursor_y(term) == 1);
assert(tt_cell(term, 0, 0)->text == 'C');
assert(tt_cell(term, 0, 1)->text == 'D');
- term_free(term);
+ wsap_vtcore_free(term);
puts("lazy screen allocation failures preserve observable terminal state");
return 0;