From ee254d3e92900986526078bb9cbef1642a51dac1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Jun 2018 09:26:17 -0400 Subject: Bring read/write interface closer to C standard --- test/test_reader_writer.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test') 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, -- cgit v1.2.1