From 0a375ebfb29b08d55824d9c18ea3812b8f6b9010 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2018 15:24:05 +0200 Subject: Add SerdWorld for shared library state --- tests/serd_test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/serd_test.c b/tests/serd_test.c index e65692d6..c797322c 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -365,6 +365,8 @@ main(void) // Test SerdEnv + SerdWorld* world = serd_world_new(); + SerdNode* u = serd_node_new_string(SERD_URI, "http://example.org/foo"); SerdNode* b = serd_node_new_string(SERD_CURIE, "invalid"); SerdNode* c = serd_node_new_string(SERD_CURIE, "eg.2:b"); @@ -418,8 +420,13 @@ main(void) FILE* fd = fopen(path, "wb"); assert(fd); - SerdWriter* writer = serd_writer_new( - SERD_TURTLE, (SerdStyle)0, env, NULL, (SerdWriteFunc)fwrite, fd); + SerdWriter* writer = serd_writer_new(world, + SERD_TURTLE, + (SerdStyle)0, + env, + NULL, + (SerdWriteFunc)fwrite, + fd); assert(writer); serd_writer_chop_blank_prefix(writer, "tmp"); @@ -495,7 +502,7 @@ main(void) // Test buffer sink SerdBuffer buffer = { NULL, 0 }; writer = serd_writer_new( - SERD_TURTLE, (SerdStyle)0, env, NULL, serd_buffer_sink, &buffer); + world, SERD_TURTLE, (SerdStyle)0, env, NULL, serd_buffer_sink, &buffer); o = serd_node_new_string(SERD_URI, "http://example.org/base"); assert(!serd_writer_set_base_uri(writer, o)); @@ -512,7 +519,7 @@ main(void) ReaderTest* rt = (ReaderTest*)calloc(1, sizeof(ReaderTest)); SerdSink sink = { rt, NULL, NULL, test_sink, NULL }; - SerdReader* reader = serd_reader_new(SERD_TURTLE, &sink); + SerdReader* reader = serd_reader_new(world, SERD_TURTLE, &sink); assert(reader); SerdNode* g = serd_node_new_string(SERD_URI, "http://example.org/"); @@ -538,6 +545,7 @@ main(void) fclose(fd); serd_env_free(env); + serd_world_free(world); printf("Success\n"); return 0; -- cgit v1.2.1