summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-09-05 07:18:28 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-09-05 07:18:28 +0000
commit5a005ad7b6d8c7b8c29c25b6ec85a6ad2a020c88 (patch)
treecfa7955497f390c47b922c6ef50e60d2ea8d73d2 /test
parent61ae94eba1c6de192db37c22668ca557237a1c95 (diff)
downloadlibparserutils-5a005ad7b6d8c7b8c29c25b6ec85a6ad2a020c88.tar.gz
libparserutils-5a005ad7b6d8c7b8c29c25b6ec85a6ad2a020c88.tar.bz2
Fix test drivers & CP1252 test data
svn path=/trunk/libparserutils/; revision=5239
Diffstat (limited to 'test')
-rw-r--r--test/cscodec-ext8.c1
-rw-r--r--test/cscodec-utf16.c1
-rw-r--r--test/cscodec-utf8.c1
-rw-r--r--test/data/cscodec-ext8/simple.datbin1321 -> 1318 bytes
-rw-r--r--test/testutils.h2
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
index 8b11d40..a278c59 100644
--- a/test/data/cscodec-ext8/simple.dat
+++ b/test/data/cscodec-ext8/simple.dat
Binary files differ
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;
}