diff options
author | David Robillard <d@drobilla.net> | 2021-01-13 14:31:00 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:23 -0500 |
commit | a7be33a7640ee51066c41eded5812d9cee5ad27e (patch) | |
tree | 8c2cbe96a6973c73320ff793d452e36fe511b745 /test | |
parent | 96bcba9cd94879794de477ae7c5c04971fbd6f32 (diff) | |
download | serd-a7be33a7640ee51066c41eded5812d9cee5ad27e.tar.gz serd-a7be33a7640ee51066c41eded5812d9cee5ad27e.tar.bz2 serd-a7be33a7640ee51066c41eded5812d9cee5ad27e.zip |
Add SerdBuffer type for mutable buffers
This avoids const violations from abusing SerdChunk as a mutable buffer
for string sinks.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_reader_writer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 573b13de..d25eb46a 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -244,16 +244,16 @@ test_writer(const char* const path) serd_writer_free(writer); - // Test chunk sink - SerdChunk chunk = {NULL, 0}; - writer = serd_writer_new( - SERD_TURTLE, (SerdStyle)0, env, NULL, serd_chunk_sink, &chunk); + // Test buffer sink + SerdBuffer buffer = {NULL, 0}; + writer = serd_writer_new( + SERD_TURTLE, (SerdStyle)0, env, NULL, serd_buffer_sink, &buffer); o = serd_node_from_string(SERD_URI, USTR("http://example.org/base")); assert(!serd_writer_set_base_uri(writer, &o)); serd_writer_free(writer); - uint8_t* out = serd_chunk_sink_finish(&chunk); + uint8_t* out = serd_buffer_sink_finish(&buffer); assert(!strcmp((const char*)out, "@base <http://example.org/base> .\n")); serd_free(out); |