aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-04-29 15:24:05 +0200
committerDavid Robillard <d@drobilla.net>2018-11-25 15:58:21 +0100
commitbcf32f9b340083c97dc2c2b144b971bb1de06a23 (patch)
tree9f9726c0e6bae3dc50fba8c0be0c3fbd9876444f /tests
parentf2a19949d0da60465e2d68b5e66a52e0d970ebd1 (diff)
downloadserd-bcf32f9b340083c97dc2c2b144b971bb1de06a23.tar.gz
serd-bcf32f9b340083c97dc2c2b144b971bb1de06a23.tar.bz2
serd-bcf32f9b340083c97dc2c2b144b971bb1de06a23.zip
Add SerdWorld for shared library state
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index d0025ec9..28e1f4b6 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -441,6 +441,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");
@@ -529,8 +531,13 @@ main(void)
FAILF("Failed to open file %s\n", path);
}
- 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);
if (!writer) {
FAIL("Failed to create writer\n");
}
@@ -623,7 +630,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");
if (serd_writer_set_base_uri(writer, o)) {
@@ -645,7 +652,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);
if (!reader) {
FAIL("Failed to create reader\n");
}
@@ -682,6 +689,7 @@ main(void)
fclose(fd);
serd_env_free(env);
+ serd_world_free(world);
printf("Success\n");
return 0;