From 27ee06024c2d54a2340e83e5c90e919f8764ae0f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 10 Feb 2018 13:32:06 +0100 Subject: Simplify reader interface --- tests/serd_test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/serd_test.c b/tests/serd_test.c index 8661af71..cee0b33b 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -123,7 +123,12 @@ test_read_chunks(void) assert(serd_reader_get_handle(reader) == rt); assert(f); - SerdStatus st = serd_reader_start_stream(reader, f, NULL, false); + SerdStatus st = serd_reader_start_stream(reader, + (SerdSource)fread, + (SerdStreamErrorFunc)ferror, + f, + NULL, + 1); assert(st == SERD_SUCCESS); // Write two statement separated by null characters @@ -159,11 +164,16 @@ test_read_chunks(void) assert(st == SERD_SUCCESS); // FIXME: return SERD_FAILURE? assert(rt->n_statements == 2); - // EOF + // FIXME: Successful read of nothing st = serd_reader_read_chunk(reader); assert(st == SERD_SUCCESS); // FIXME: return SERD_FAILURE? assert(rt->n_statements == 2); + // EOF + st = serd_reader_read_chunk(reader); + assert(st == SERD_FAILURE); + assert(rt->n_statements == 2); + serd_reader_free(reader); fclose(f); } -- cgit v1.2.1