aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-13 21:04:54 +0200
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:48 -0500
commit8e5dbd1d5b62f66888dbf74929240da0b7ab465b (patch)
tree51183805ec41f5acb2c07ec17a64d189687c389a /tests
parent87a1b30968d422831615ffb2fce33603a3e24e84 (diff)
downloadserd-8e5dbd1d5b62f66888dbf74929240da0b7ab465b.tar.gz
serd-8e5dbd1d5b62f66888dbf74929240da0b7ab465b.tar.bz2
serd-8e5dbd1d5b62f66888dbf74929240da0b7ab465b.zip
Separate ByteSink from Writer
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 9604ecd7..22628dd3 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -551,15 +551,23 @@ main(void)
serd_node_free(urn_Type);
// 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);
o = serd_new_uri("http://example.org/base");
assert(!serd_writer_set_base_uri(writer, o));
serd_node_free(o);
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"));