aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-03-15 23:21:34 -0400
committerDavid Robillard <d@drobilla.net>2019-04-13 19:15:32 +0200
commita549e968cd3f840dc98b2e199c5f52e9f5a5780c (patch)
tree47b9f12595dc62af719a58ccf2e83d20743b0c95 /tests
parent499e27a6849cb98235bf9425f1fdb96c8da2c8c5 (diff)
downloadserd-a549e968cd3f840dc98b2e199c5f52e9f5a5780c.tar.gz
serd-a549e968cd3f840dc98b2e199c5f52e9f5a5780c.tar.bz2
serd-a549e968cd3f840dc98b2e199c5f52e9f5a5780c.zip
Use SerdBuffer for mutable buffers
This avoids const violations from abusing SerdChunk as a mutable buffer for string sinks.
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index e537a5f5..12899de2 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -484,16 +484,16 @@ main(void)
serd_writer_free(writer);
- // Test chunk sink
- SerdChunk chunk = { NULL, 0 };
+ // Test buffer sink
+ SerdBuffer buffer = { NULL, 0 };
writer = serd_writer_new(
- SERD_TURTLE, (SerdStyle)0, env, NULL, serd_chunk_sink, &chunk);
+ 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);