diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 15:24:05 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-12-30 17:58:17 -0500 |
commit | 9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa (patch) | |
tree | 89fa93f202f9e992d3ea24650ec4c418493ffe6c /tests | |
parent | aebfe13a070ee542929e0ec19b4b2e9221dc1582 (diff) | |
download | serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.tar.gz serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.tar.bz2 serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.zip |
Add SerdWorld for shared library state
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index cdea3810..2f0d32fe 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"); @@ -417,8 +419,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"); @@ -494,7 +501,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)); @@ -511,7 +518,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/"); @@ -537,6 +544,7 @@ main(void) fclose(fd); serd_env_free(env); + serd_world_free(world); printf("Success\n"); return 0; |