aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-15 15:15:55 -0400
committerDavid Robillard <d@drobilla.net>2019-04-13 19:15:32 +0200
commit652e7cfe62f629deb7a5a427d3cb77d78e532ec6 (patch)
tree2041c1ce1e0a8f3a1671aa694575bacef877d5bc /tests
parent37251f892794e7accbabbe8a2816ad71191e2174 (diff)
downloadserd-652e7cfe62f629deb7a5a427d3cb77d78e532ec6.tar.gz
serd-652e7cfe62f629deb7a5a427d3cb77d78e532ec6.tar.bz2
serd-652e7cfe62f629deb7a5a427d3cb77d78e532ec6.zip
Make SerdSink opaque
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 2fddc5bf..de1fd5e6 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -482,9 +482,9 @@ main(void)
serd_writer_chop_blank_prefix(writer, NULL);
const SerdSink* iface = serd_writer_get_sink(writer);
- assert(iface->base(iface->handle, lit));
- assert(iface->prefix(iface->handle, lit, lit));
- assert(iface->end(iface->handle, NULL));
+ assert(serd_sink_write_base(iface, lit));
+ assert(serd_sink_write_prefix(iface, lit, lit));
+ assert(serd_sink_write_end(iface, NULL));
assert(serd_writer_get_env(writer) == env);
uint8_t buf[] = { 0xEF, 0xBF, 0xBD, 0 };
@@ -568,9 +568,11 @@ main(void)
// Rewind and test reader
fseek(fd, 0, SEEK_SET);
- ReaderTest rt = { 0, NULL };
- SerdSink sink = { &rt, NULL, NULL, test_sink, NULL };
- SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink, 4096);
+ ReaderTest rt = { 0, NULL };
+ SerdSink* sink = serd_sink_new(&rt);
+ serd_sink_set_statement_func(sink, test_sink);
+
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
assert(reader);
SerdNode* g = serd_new_uri("http://example.org/");
@@ -591,6 +593,7 @@ main(void)
serd_reader_finish(reader);
serd_reader_free(reader);
+ serd_sink_free(sink);
fclose(fd);
serd_env_free(env);