r5239 jmb - in /trunk/libparserutils/test: cscodec-ext8.c cscodec-utf16.c cscodec-utf8.c data/cscodec-ext8/simple.dat testutils.h

netsurf at semichrome.net netsurf at semichrome.net
Fri Sep 5 08:18:29 BST 2008


Author: jmb
Date: Fri Sep  5 02:18:28 2008
New Revision: 5239

URL: http://source.netsurf-browser.org?rev=5239&view=rev
Log:
Fix test drivers & CP1252 test data

Modified:
    trunk/libparserutils/test/cscodec-ext8.c
    trunk/libparserutils/test/cscodec-utf16.c
    trunk/libparserutils/test/cscodec-utf8.c
    trunk/libparserutils/test/data/cscodec-ext8/simple.dat
    trunk/libparserutils/test/testutils.h

Modified: trunk/libparserutils/test/cscodec-ext8.c
URL: http://source.netsurf-browser.org/trunk/libparserutils/test/cscodec-ext8.c?rev=5239&r1=5238&r2=5239&view=diff
==============================================================================
--- trunk/libparserutils/test/cscodec-ext8.c (original)
+++ trunk/libparserutils/test/cscodec-ext8.c Fri Sep  5 02:18:28 2008
@@ -247,6 +247,7 @@
 		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);

Modified: trunk/libparserutils/test/cscodec-utf16.c
URL: http://source.netsurf-browser.org/trunk/libparserutils/test/cscodec-utf16.c?rev=5239&r1=5238&r2=5239&view=diff
==============================================================================
--- trunk/libparserutils/test/cscodec-utf16.c (original)
+++ trunk/libparserutils/test/cscodec-utf16.c Fri Sep  5 02:18:28 2008
@@ -296,6 +296,7 @@
 		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);

Modified: trunk/libparserutils/test/cscodec-utf8.c
URL: http://source.netsurf-browser.org/trunk/libparserutils/test/cscodec-utf8.c?rev=5239&r1=5238&r2=5239&view=diff
==============================================================================
--- trunk/libparserutils/test/cscodec-utf8.c (original)
+++ trunk/libparserutils/test/cscodec-utf8.c Fri Sep  5 02:18:28 2008
@@ -231,6 +231,7 @@
 		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);

Modified: trunk/libparserutils/test/data/cscodec-ext8/simple.dat
URL: http://source.netsurf-browser.org/trunk/libparserutils/test/data/cscodec-ext8/simple.dat?rev=5239&r1=5238&r2=5239&view=diff
==============================================================================
Binary files - no diff available.

Modified: trunk/libparserutils/test/testutils.h
URL: http://source.netsurf-browser.org/trunk/libparserutils/test/testutils.h?rev=5239&r1=5238&r2=5239&view=diff
==============================================================================
--- trunk/libparserutils/test/testutils.h (original)
+++ trunk/libparserutils/test/testutils.h Fri Sep  5 02:18:28 2008
@@ -59,7 +59,7 @@
 		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;
 		}




More information about the netsurf-commits mailing list