From 7f7a2fb4fb23433e7be3d6953725690c8ea958d2 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 31 Aug 2026 19:44:56 +0000 Subject: The objects returned to the user are now integer-based references, not actual pointers. This means the aplwc internals can update those pointers without the user noticing. FossilOrigin-Name: 654c7d0ec85da295a7fb6ed381500410686b280f342fa81a30481f5e9a20c58a --- tests/aplwc_utf8.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/aplwc_utf8.c') diff --git a/tests/aplwc_utf8.c b/tests/aplwc_utf8.c index 4f9f2a4..367db5d 100644 --- a/tests/aplwc_utf8.c +++ b/tests/aplwc_utf8.c @@ -35,7 +35,7 @@ int main(void) { struct aplwc *aplwc; - struct aplwc_line *line; + AplwcLine line; struct aplwc_fns fns; enum aplwc_rc ret; size_t i; @@ -62,13 +62,13 @@ main(void) fns.alloc = my_alloc; fns.dealloc = my_dealloc; - ret = aplwc_new(&aplwc, fns); + aplwc = aplwc_new(fns, &ret); if(ret) return 1; for(i = 0; i < (sizeof(bad_tests)/sizeof(*bad_tests)); i++){ line = aplwc_read(aplwc, (char *)bad_tests[i]); - if(line != NULL) + if(aplwc_valid_line(line)) return 1; if(aplwc_last_error(aplwc) != APLWC_INVALID_UTF8) return 1; @@ -77,7 +77,7 @@ main(void) for(i = 0; i < (sizeof(good_tests)/sizeof(*good_tests)); i++){ line = aplwc_read(aplwc, (char *)good_tests[i]); - if((line == NULL) && (aplwc_last_error(aplwc) == APLWC_INVALID_UTF8)) + if((!aplwc_valid_line(line)) && (aplwc_last_error(aplwc) == APLWC_INVALID_UTF8)) return 1; aplwc_free_line(line); } -- cgit v1.2.3