aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 5998588c..ba8ca2ce 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -108,11 +108,12 @@ test_file_uri(const char* hostname,
static void
test_read_chunks(void)
{
+ SerdWorld* world = serd_world_new();
ReaderTest* const rt = (ReaderTest*)calloc(1, sizeof(ReaderTest));
FILE* const f = tmpfile();
static const char null = 0;
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);
assert(f);
@@ -171,6 +172,7 @@ test_read_chunks(void)
serd_reader_free(reader);
fclose(f);
free(rt);
+ serd_world_free(world);
}
static void
@@ -530,8 +532,15 @@ test_writer(const char* const path)
SerdEnv* env = serd_env_new(NULL);
assert(fd);
- SerdWriter* writer = serd_writer_new(
- SERD_TURTLE, (SerdStyle)0, env, NULL, (SerdWriteFunc)fwrite, fd);
+ SerdWorld* world = serd_world_new();
+
+ SerdWriter* writer = serd_writer_new(world,
+ SERD_TURTLE,
+ (SerdStyle)0,
+ env,
+ NULL,
+ (SerdWriteFunc)fwrite,
+ fd);
assert(writer);
serd_writer_chop_blank_prefix(writer, "tmp");
@@ -609,7 +618,7 @@ test_writer(const char* const path)
// 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));
@@ -621,15 +630,17 @@ test_writer(const char* const path)
assert(!strcmp(out, "@base <http://example.org/base> .\n"));
serd_free(out);
serd_env_free(env);
+ serd_world_free(world);
fclose(fd);
}
static void
test_reader(const char* path)
{
+ SerdWorld* world = serd_world_new();
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/");
@@ -652,6 +663,7 @@ test_reader(const char* path)
serd_reader_free(reader);
free(rt);
+ serd_world_free(world);
}
int