diff options
author | David Robillard <d@drobilla.net> | 2018-07-13 21:04:54 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:04 +0200 |
commit | 4f2640a2e4689cdda26a914c77aa2822a06da0f5 (patch) | |
tree | c124fe5fae4908f9e8e48697080db5b6debcfe7c /tests | |
parent | a018e7a0c9e3146a6266e8de7a9af5069ef69bbd (diff) | |
download | serd-4f2640a2e4689cdda26a914c77aa2822a06da0f5.tar.gz serd-4f2640a2e4689cdda26a914c77aa2822a06da0f5.tar.bz2 serd-4f2640a2e4689cdda26a914c77aa2822a06da0f5.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 d5b8d33b..a50ee846 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -703,15 +703,23 @@ test_writer(const char* const path) 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")); |