diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cscodec-ext8.c | 1 | ||||
-rw-r--r-- | test/cscodec-utf16.c | 1 | ||||
-rw-r--r-- | test/cscodec-utf8.c | 1 | ||||
-rw-r--r-- | test/data/cscodec-ext8/simple.dat | bin | 1321 -> 1318 bytes | |||
-rw-r--r-- | test/testutils.h | 2 |
5 files changed, 4 insertions, 1 deletions
diff --git a/test/cscodec-ext8.c b/test/cscodec-ext8.c index 14c641f..6378cd4 100644 --- a/test/cscodec-ext8.c +++ b/test/cscodec-ext8.c @@ -247,6 +247,7 @@ void run_test(line_ctx *ctx) assert(srclen == 0); assert(ctx->buf + ctx->bufused == psrc); assert(dest + (ctx->bufused * 4 - destlen) == pdest); + assert(ctx->bufused * 4 - destlen == ctx->expused); } printf("%d: Read '", ++testnum); diff --git a/test/cscodec-utf16.c b/test/cscodec-utf16.c index ee74662..f342e6c 100644 --- a/test/cscodec-utf16.c +++ b/test/cscodec-utf16.c @@ -296,6 +296,7 @@ void run_test(line_ctx *ctx) assert(srclen == 0); assert(ctx->buf + ctx->bufused == psrc); assert(dest + (ctx->bufused * 4 - destlen) == pdest); + assert(ctx->bufused * 4 - destlen == ctx->expused); } printf("%d: Read '", ++testnum); diff --git a/test/cscodec-utf8.c b/test/cscodec-utf8.c index f3cabcc..5d0580b 100644 --- a/test/cscodec-utf8.c +++ b/test/cscodec-utf8.c @@ -231,6 +231,7 @@ void run_test(line_ctx *ctx) assert(srclen == 0); assert(ctx->buf + ctx->bufused == psrc); assert(dest + (ctx->bufused * 4 - destlen) == pdest); + assert(ctx->bufused * 4 - destlen == ctx->expused); } printf("%d: Read '", ++testnum); diff --git a/test/data/cscodec-ext8/simple.dat b/test/data/cscodec-ext8/simple.dat Binary files differindex 8b11d40..a278c59 100644 --- a/test/data/cscodec-ext8/simple.dat +++ b/test/data/cscodec-ext8/simple.dat diff --git a/test/testutils.h b/test/testutils.h index c91c5b8..77cbd6a 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -59,7 +59,7 @@ bool parse_testfile(const char *filename, line_func callback, void *pw) if (buf[0] == '\n') continue; - if (!callback(buf, parse_strlen(buf, sizeof buf), pw)) { + if (!callback(buf, parse_strlen(buf, sizeof buf - 1), pw)) { fclose(fp); return false; } |