diff options
author | David Robillard <d@drobilla.net> | 2018-07-13 21:04:54 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 19:15:32 +0200 |
commit | 5de7dc6ab43b15d01937364218862dc174343b31 (patch) | |
tree | da45850a950bc96c62cc18a270808046797e542c /tests | |
parent | 9aa551a5bada683db9272937ab73ae43882cb978 (diff) | |
download | serd-5de7dc6ab43b15d01937364218862dc174343b31.tar.gz serd-5de7dc6ab43b15d01937364218862dc174343b31.tar.bz2 serd-5de7dc6ab43b15d01937364218862dc174343b31.zip |
Separate ByteSink from Writer
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index f1d6fad9..97966515 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")); |