diff options
author | David Robillard <d@drobilla.net> | 2018-06-15 09:26:17 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:24 -0500 |
commit | ee254d3e92900986526078bb9cbef1642a51dac1 (patch) | |
tree | 5e3197d7abbebde216024efec5b7189559ac6b4e /test/test_reader_writer.c | |
parent | 9a8e06aa5bdc62ed589bd8ed5789bd059cec0700 (diff) | |
download | serd-ee254d3e92900986526078bb9cbef1642a51dac1.tar.gz serd-ee254d3e92900986526078bb9cbef1642a51dac1.tar.bz2 serd-ee254d3e92900986526078bb9cbef1642a51dac1.zip |
Bring read/write interface closer to C standard
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r-- | test/test_reader_writer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 48bb508e..91e95806 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -89,7 +89,7 @@ test_read_chunks(void) assert(f); SerdStatus st = serd_reader_start_stream( - reader, (SerdSource)fread, (SerdStreamErrorFunc)ferror, f, NULL, 1); + reader, (SerdReadFunc)fread, (SerdStreamErrorFunc)ferror, f, NULL, 1); assert(st == SERD_SUCCESS); // Write two statement separated by null characters @@ -163,7 +163,8 @@ test_writer(const char* const path) SerdEnv* env = serd_env_new(SERD_EMPTY_STRING()); assert(fd); - SerdWriter* writer = serd_writer_new(SERD_TURTLE, 0, env, serd_file_sink, fd); + SerdWriter* writer = + serd_writer_new(SERD_TURTLE, 0, env, (SerdWriteFunc)fwrite, fd); assert(writer); serd_writer_chop_blank_prefix(writer, "tmp"); @@ -292,8 +293,12 @@ test_reader(const char* path) fflush(temp); fseek(temp, 0L, SEEK_SET); - serd_reader_start_stream( - reader, (SerdSource)fread, (SerdStreamErrorFunc)ferror, temp, NULL, 4096); + serd_reader_start_stream(reader, + (SerdReadFunc)fread, + (SerdStreamErrorFunc)ferror, + temp, + NULL, + 4096); assert(serd_reader_read_chunk(reader) == SERD_SUCCESS); assert(serd_reader_read_chunk(reader) == SERD_FAILURE); @@ -307,7 +312,7 @@ test_reader(const char* path) { size_t n_reads = 0; serd_reader_start_stream(reader, - (SerdSource)eof_test_read, + (SerdReadFunc)eof_test_read, (SerdStreamErrorFunc)eof_test_error, &n_reads, NULL, |