aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_reader_writer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c
index b43337f5..f4fa6127 100644
--- a/test/test_reader_writer.c
+++ b/test/test_reader_writer.c
@@ -247,9 +247,12 @@ test_writer(const char* const path)
serd_node_free(l);
// Test buffer sink
- SerdBuffer buffer = {NULL, 0};
- writer =
- serd_writer_new(world, SERD_TURTLE, 0, env, serd_buffer_sink, &buffer);
+ SerdBuffer buffer = {NULL, 0};
+ SerdByteSink* byte_sink =
+ serd_byte_sink_new((SerdWriteFunc)serd_buffer_sink, &buffer, 1);
+
+ writer = serd_writer_new(
+ world, SERD_TURTLE, 0, env, (SerdWriteFunc)serd_byte_sink_write, byte_sink);
SerdNode* const base =
serd_new_uri(SERD_STATIC_STRING("http://example.org/base"));
@@ -258,6 +261,7 @@ test_writer(const char* const path)
serd_node_free(base);
serd_writer_free(writer);
+ serd_byte_sink_free(byte_sink);
char* out = serd_buffer_sink_finish(&buffer);
assert(!strcmp(out, "@base <http://example.org/base> .\n"));