diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:40:44 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:40:44 +0300 |
| commit | 7b31d6a05357953c035e2ab05ec117ef748f7798 (patch) | |
| tree | 26fea99ff05dce6f076b74e35a19c14a53762653 /tests/api_args_test.c | |
| parent | ca69844a243a6e335b0ddafad057f35e89e0a576 (diff) | |
Reject a scrollback above TERM_SCROLLBACK_MAX
term_new() silently cut a scrollback above 1000000 lines to 1000000.
The limit now has a name in term.h, and term_new() returns NULL above
it, as it does for the other invalid options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/api_args_test.c')
| -rw-r--r-- | tests/api_args_test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/api_args_test.c b/tests/api_args_test.c index 18af728..6c7dfc7 100644 --- a/tests/api_args_test.c +++ b/tests/api_args_test.c @@ -75,6 +75,16 @@ static void test_new_rejects_bad_options(void) assert(!term_new(&opt)); memset(&opt, 0, sizeof(opt)); + opt.scrollback = TERM_SCROLLBACK_MAX + 1; + assert(!term_new(&opt)); + + memset(&opt, 0, sizeof(opt)); + opt.scrollback = TERM_SCROLLBACK_MAX; + struct term *max = term_new(&opt); + assert(max); + term_free(max); + + memset(&opt, 0, sizeof(opt)); opt.cursor_style = (enum term_cursor_style)3; assert(!term_new(&opt)); |
