diff options
author | David Robillard <d@drobilla.net> | 2011-01-25 19:34:23 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-25 19:34:23 +0000 |
commit | c6d028b2ea6ac478fe644b671ca9d09ddb79e926 (patch) | |
tree | 00d758bc7bee6b9a3279a60b5225f23a1ed23271 | |
parent | b56591a0838bd9e402d366e53b3f0cacc1ddc35d (diff) | |
download | serd-c6d028b2ea6ac478fe644b671ca9d09ddb79e926.tar.gz serd-c6d028b2ea6ac478fe644b671ca9d09ddb79e926.tar.bz2 serd-c6d028b2ea6ac478fe644b671ca9d09ddb79e926.zip |
Fix/test reading empty files.
git-svn-id: http://svn.drobilla.net/serd/trunk@70 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r-- | src/reader.c | 3 | ||||
-rw-r--r-- | wscript | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/reader.c b/src/reader.c index a0d74642..b1d0279f 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1407,8 +1407,7 @@ serd_reader_read_file(SerdReader me, FILE* file, const uint8_t* name) memset(me->read_buf, '\0', READ_BUF_LEN * 2); me->read_buf += READ_BUF_LEN; - page(me); - const bool ret = read_turtleDoc(me); + const bool ret = !page(me) || read_turtleDoc(me); free(me->read_buf - READ_BUF_LEN); me->fd = 0; @@ -128,7 +128,8 @@ def test(ctx): './serdi_static file://../tests/manifest.ttl > /dev/null', './serdi_static ../tests/UTF-8.ttl > /dev/null', './serdi_static -v > /dev/null', - './serdi_static -s "<foo> a <#Thingie> ." > /dev/null'], + './serdi_static -s "<foo> a <#Thingie> ." > /dev/null', + './serdi_static /dev/null > /dev/null'], 0, name='serdi-cmd-good') autowaf.run_tests(ctx, APPNAME, @@ -136,7 +137,8 @@ def test(ctx): './serdi_static ftp://example.org/unsupported.ttl > /dev/null', './serdi_static -o > /dev/null', './serdi_static -z > /dev/null', - './serdi_static -o illegal > /dev/null'], + './serdi_static -o illegal > /dev/null', + './serdi_static /no/such/file > /dev/null'], 1, name='serdi-cmd-bad') commands = [] |