summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-04-17 16:30:14 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-04-17 16:30:14 +0000
commit1ae4c6f0e96a7ecfc09bf39db5cf25cfe6bd5a81 (patch)
tree59d7e0619a17402fabdb83547213e9ef65097826 /test
parentbd4da673b15339d7a4a1cb32f35c631e122020c0 (diff)
downloadlibcss-1ae4c6f0e96a7ecfc09bf39db5cf25cfe6bd5a81.tar.gz
libcss-1ae4c6f0e96a7ecfc09bf39db5cf25cfe6bd5a81.tar.bz2
Pretend we care about fread/fwrite succeeding
svn path=/trunk/libcss/; revision=7124
Diffstat (limited to 'test')
-rw-r--r--test/css21.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/css21.c b/test/css21.c
index ec5979f..5a84489 100644
--- a/test/css21.c
+++ b/test/css21.c
@@ -60,7 +60,8 @@ int main(int argc, char **argv)
fseek(fp, 0, SEEK_SET);
while (len >= CHUNK_SIZE) {
- fread(buf, 1, CHUNK_SIZE, fp);
+ size_t read = fread(buf, 1, CHUNK_SIZE, fp);
+ assert(read == CHUNK_SIZE);
error = css_stylesheet_append_data(sheet, buf,
CHUNK_SIZE);
@@ -70,7 +71,8 @@ int main(int argc, char **argv)
}
if (len > 0) {
- fread(buf, 1, len, fp);
+ size_t read = fread(buf, 1, len, fp);
+ assert(read == len);
error = css_stylesheet_append_data(sheet, buf, len);
assert(error == CSS_OK || error == CSS_NEEDDATA);
@@ -118,10 +120,12 @@ int main(int argc, char **argv)
{
char *out;
size_t outlen = origlen * 2;
+ size_t written;
out = malloc(outlen);
assert(out != NULL);
dump_sheet(sheet, out, &outlen);
- fwrite(out, origlen * 2 - outlen, 1, stdout);
+ written = fwrite(out, 1, origlen * 2 - outlen, stdout);
+ assert(written == origlen * 2 - outlen);
free(out);
}
#endif