diff options
author | David Robillard <d@drobilla.net> | 2016-03-15 23:21:34 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-25 09:21:03 +0100 |
commit | f046eb982627f344fc0eeff6be82028318862e67 (patch) | |
tree | a8216165d6e74ff5650e4cdd5a2a44b05b611f63 /tests | |
parent | fc6ef04d8b94909523708c1bdbb9ea8f42063662 (diff) | |
download | serd-f046eb982627f344fc0eeff6be82028318862e67.tar.gz serd-f046eb982627f344fc0eeff6be82028318862e67.tar.bz2 serd-f046eb982627f344fc0eeff6be82028318862e67.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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 4997629f..0ffcdf51 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -602,10 +602,10 @@ 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")); if (serd_writer_set_base_uri(writer, &o)) { @@ -613,10 +613,10 @@ main(void) } serd_writer_free(writer); - uint8_t* out = serd_chunk_sink_finish(&chunk); + uint8_t* out = serd_buffer_sink_finish(&buffer); if (strcmp((const char*)out, "@base <http://example.org/base> .\n")) { - FAILF("Incorrect chunk output:\n%s\n", chunk.buf); + FAILF("Incorrect buffer output:\n%s\n", buffer.buf); } serd_free(out); |