aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_reader_writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r--test/test_reader_writer.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c
index 036e49d7..48f20247 100644
--- a/test/test_reader_writer.c
+++ b/test/test_reader_writer.c
@@ -79,11 +79,12 @@ eof_test_error(void* stream)
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 = serd_sink_new(rt, NULL);
- SerdReader* reader = serd_reader_new(SERD_TURTLE, sink, 4096);
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
assert(reader);
assert(sink);
@@ -136,14 +137,16 @@ test_read_chunks(void)
serd_sink_free(sink);
fclose(f);
free(rt);
+ serd_world_free(world);
}
static void
test_read_string(void)
{
+ SerdWorld* world = serd_world_new();
ReaderTest* rt = (ReaderTest*)calloc(1, sizeof(ReaderTest));
SerdSink* sink = serd_sink_new(rt, NULL);
- SerdReader* reader = serd_reader_new(SERD_TURTLE, sink, 4096);
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
assert(reader);
assert(sink);
@@ -163,6 +166,7 @@ test_read_string(void)
serd_reader_free(reader);
serd_sink_free(sink);
free(rt);
+ serd_world_free(world);
}
static void
@@ -172,8 +176,10 @@ test_writer(const char* const path)
SerdEnv* env = serd_env_new(SERD_EMPTY_STRING());
assert(fd);
+ SerdWorld* world = serd_world_new();
+
SerdWriter* writer =
- serd_writer_new(SERD_TURTLE, 0, env, (SerdWriteFunc)fwrite, fd);
+ serd_writer_new(world, SERD_TURTLE, 0, env, (SerdWriteFunc)fwrite, fd);
assert(writer);
serd_writer_chop_blank_prefix(writer, "tmp");
@@ -242,7 +248,8 @@ test_writer(const char* const path)
// Test buffer sink
SerdBuffer buffer = {NULL, 0};
- writer = serd_writer_new(SERD_TURTLE, 0, env, serd_buffer_sink, &buffer);
+ writer =
+ serd_writer_new(world, SERD_TURTLE, 0, env, serd_buffer_sink, &buffer);
SerdNode* const base =
serd_new_uri(SERD_STATIC_STRING("http://example.org/base"));
@@ -260,15 +267,17 @@ test_writer(const char* const path)
serd_node_free(s);
serd_env_free(env);
+ serd_world_free(world);
fclose(fd);
}
static void
test_reader(const char* path)
{
+ SerdWorld* world = serd_world_new();
ReaderTest rt = {0, NULL};
SerdSink* const sink = serd_sink_new(&rt, NULL);
- SerdReader* reader = serd_reader_new(SERD_TURTLE, sink, 4096);
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096);
assert(reader);
assert(sink);
@@ -341,6 +350,7 @@ test_reader(const char* path)
serd_reader_free(reader);
serd_sink_free(sink);
+ serd_world_free(world);
}
int