vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: edaaf0ce489f04f6249a5decec53da01753acf17
Parent: 2f79cb6313b4316457fe9f2f3333575ec8c69386
Author: Randy Palamar
Date:   Sun, 11 Aug 2024 15:58:48 -0600

test: check if ring buffer works

Diffstat:
Mtest.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test.c b/test.c @@ -17,7 +17,8 @@ typedef TEST_FN(Test_Fn); #define TESTS \ X(colour_setting) \ X(cursor_at_line_boundary) \ - X(cursor_movement) + X(cursor_movement) \ + X(working_ringbuffer) #define X(fn) static TEST_FN(fn); TESTS @@ -169,6 +170,15 @@ static TEST_FN(cursor_at_line_boundary) return result; } +static TEST_FN(working_ringbuffer) +{ + struct test_result result = {.info = __FUNCTION__}; + term->log.buf[0] = 0xFE; + result.status = (term->log.buf[0] == term->log.buf[term->log.cap]) && + (term->log.buf[0] == term->log.buf[-term->log.cap]); + return result; +} + static u32 failure_count; int