diff options
author | David Robillard <d@drobilla.net> | 2018-02-10 13:32:06 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:03 +0200 |
commit | 27ee06024c2d54a2340e83e5c90e919f8764ae0f (patch) | |
tree | 75810ccb7871446552f41c76c10a0821c3d46d9c /tests | |
parent | 77b496a15d3c263a1bbc7c4cc56583f4014c1d22 (diff) | |
download | serd-27ee06024c2d54a2340e83e5c90e919f8764ae0f.tar.gz serd-27ee06024c2d54a2340e83e5c90e919f8764ae0f.tar.bz2 serd-27ee06024c2d54a2340e83e5c90e919f8764ae0f.zip |
Simplify reader interface
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); } |